diff --git a/svelte/src/filesystem/ShareDialog.svelte b/svelte/src/filesystem/ShareDialog.svelte index e596e91..e859270 100644 --- a/svelte/src/filesystem/ShareDialog.svelte +++ b/svelte/src/filesystem/ShareDialog.svelte @@ -93,15 +93,11 @@ const share = async () => { } const nav_share = async (url: string) => { - try { - await navigator.share({ - title: base.name, - text: "I would like to share '" + base.name + "' with you", - url: url, - }) - } catch(err) { - alert("navigator share not available: "+ err) - } + await navigator.share({ + title: base.name, + text: "I would like to share '" + base.name + "' with you", + url: url, + }) } diff --git a/svelte/src/filesystem/edit_window/EditWindow.svelte b/svelte/src/filesystem/edit_window/EditWindow.svelte index 1741da3..ce47dde 100644 --- a/svelte/src/filesystem/edit_window/EditWindow.svelte +++ b/svelte/src/filesystem/edit_window/EditWindow.svelte @@ -6,7 +6,7 @@ import { branding_from_props } from "./Branding"; import FileOptions from "./FileOptions.svelte"; import SharingOptions from "./SharingOptions.svelte"; import type { FSNavigator } from "filesystem/FSNavigator"; -import { loading_finish, loading_start } from "lib/Loading"; +import { loading_run } from "lib/Loading"; let file: FSNode = $state({} as FSNode) let options: NodeOptions = $state({} as NodeOptions) @@ -72,23 +72,22 @@ const save = async (e: SubmitEvent) => { e.preventDefault() console.debug("Saving file", file.path) - let new_file: FSNode try { - loading_start() - options.branding_enabled = JSON.stringify(branding_enabled) + await loading_run(async () => { + options.branding_enabled = JSON.stringify(branding_enabled) - new_file = await fs_update(file.path, options) + await fs_update(file.path, options) - if (new_name !== file.name) { - let parent = file.path.slice(0, -file.name.length) - console.log("Moving", file.path, "to", parent+new_name) + // If the file name has changed we need to call fs_rename. This is a + // separate operation because a rename also moves the file + if (new_name !== file.name) { + let parent = file.path.slice(0, -file.name.length) + console.log("Moving", file.path, "to", parent+new_name) - await fs_rename(file.path, parent+new_name) - file.path = parent+new_name - - new_file.name = new_name - new_file.path = file.path - } + await fs_rename(file.path, parent+new_name) + file.path = parent+new_name + } + }) } catch (err) { if (err.message) { alert(err.message) @@ -97,11 +96,11 @@ const save = async (e: SubmitEvent) => { alert(err) } return - } finally { - loading_finish() } - if (open_after_edit) { + // The navigate call will be debounced if the new path is equal to the + // current path. So we call reload() instead if that's the case + if (open_after_edit && $nav.base.path !== file.path) { nav.navigate(file.path, false) } else { nav.reload() diff --git a/svelte/src/lib/FilesystemAPI.svelte.ts b/svelte/src/lib/FilesystemAPI.svelte.ts index f0f5932..4d0241d 100644 --- a/svelte/src/lib/FilesystemAPI.svelte.ts +++ b/svelte/src/lib/FilesystemAPI.svelte.ts @@ -190,7 +190,7 @@ export const fs_get_node = async (path: string) => { // - shared, boolean. If true the node will receive a public ID // // Returns the modified filesystem node object -export const fs_update = async (path: string, opts: NodeOptions) => { +export const fs_update = async (path: string, opts: NodeOptions): Promise => { const form = new FormData() form.append("action", "update") diff --git a/svelte/src/user_home/HotlinkProgressBar.svelte b/svelte/src/user_home/HotlinkProgressBar.svelte index 52cc6fb..062e573 100644 --- a/svelte/src/user_home/HotlinkProgressBar.svelte +++ b/svelte/src/user_home/HotlinkProgressBar.svelte @@ -37,7 +37,7 @@ let frac = $derived(used / total) {#if $user !== null && $user.monthly_transfer_cap > 0}

You have a billshock limit configured. increase or disable the limit to + href="/user/sharing">increase or disable the limit to continue sharing files.

{/if} @@ -59,7 +59,7 @@ let frac = $derived(used / total) {#if $user !== null && $user.monthly_transfer_cap > 0}

You have a billshock limit configured. increase or disable the limit to + href="/user/sharing">increase or disable the limit to continue sharing files.

{/if} diff --git a/svelte/src/user_home/Subscription.svelte b/svelte/src/user_home/Subscription.svelte index 67c351c..5195ad5 100644 --- a/svelte/src/user_home/Subscription.svelte +++ b/svelte/src/user_home/Subscription.svelte @@ -7,7 +7,6 @@ import { user } from "lib/UserStore"; import { put_user } from "lib/NovaAPI"; let subscription: string = $state($user === null ? "" : $user.subscription.id) -let subscription_type: string = $state($user === null ? "" : $user.subscription.type) let success_message: SuccessMessage = $state() const update = async (plan: string) => { @@ -71,13 +70,6 @@ const update = async (plan: string) => {

Here you can switch between different subscription plans.

-

- The Patreon subscription is managed by Patreon. Nova cannot modify - or end your subsciption. If you would like to cancel your Patreon plan - you can do that on Patreon. -

The Prepaid subscription is charged daily based on usage. When you reach negative balance the subscription will automatically end. You need at @@ -91,41 +83,6 @@ const update = async (plan: string) => {

-
-
- Patreon
- {#if subscription_type === "patreon"} - Currently active
- - settings - Manage - - {:else} - - add_link - Link Patreon - - {/if} -
-
-

- This subscription is managed by Patreon. You will need to purchase a plan on Patreon before you - can activate this subscription. After your purchase you can - click the "Link Patreon" button and your account will be - upgraded. -

-
    -
  • €4 per month
  • -
  • No storage limit for file sharing
  • -
  • 4 TB transfer limit (higher plans available)
  • -
  • Access to the filesystem
  • -
  • 2 TB filesytem storage limit (higher plans available)
  • -
-
-
-
Prepaid
@@ -141,11 +98,7 @@ const update = async (plan: string) => {

You will need a positive account balance to activate this - plan. If you currently have a Patreon subscription active, - then enabling prepaid will not cancel that subscription. You - can end your subscription on Patreon.com. + plan. The plan deactivates when your credit runs out.

@@ -177,8 +130,8 @@ const update = async (plan: string) => {
    -
  • Standard free plan, files expire after 120 days.
  • -
  • Download limit of 6 GB per day
  • +
  • Storage limit: 50 GB
  • +
  • Download limit: 50 GB per 30 days (sliding window)
diff --git a/svelte/src/user_home/dashboard/CardUsage.svelte b/svelte/src/user_home/dashboard/CardUsage.svelte index cf166d6..3aafa58 100644 --- a/svelte/src/user_home/dashboard/CardUsage.svelte +++ b/svelte/src/user_home/dashboard/CardUsage.svelte @@ -58,6 +58,6 @@ onMount(async () => {

Egress used (30 days): - (set custom limit) + (set custom limit) {/if}