Fix error popup when canceling a sharing action
Fix navigator not reloading when saving an edited file Remove dead links Remove references to Patreon
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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<FSNode> => {
|
||||
const form = new FormData()
|
||||
form.append("action", "update")
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ let frac = $derived(used / total)
|
||||
{#if $user !== null && $user.monthly_transfer_cap > 0}
|
||||
<p>
|
||||
You have a billshock limit configured. <a
|
||||
href="/user/sharing/bandwidth">increase or disable the limit</a> to
|
||||
href="/user/sharing">increase or disable the limit</a> to
|
||||
continue sharing files.
|
||||
</p>
|
||||
{/if}
|
||||
@@ -59,7 +59,7 @@ let frac = $derived(used / total)
|
||||
{#if $user !== null && $user.monthly_transfer_cap > 0}
|
||||
<p>
|
||||
You have a billshock limit configured. <a
|
||||
href="/user/sharing/bandwidth">increase or disable the limit</a> to
|
||||
href="/user/sharing">increase or disable the limit</a> to
|
||||
continue sharing files.
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
@@ -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) => {
|
||||
<p>
|
||||
Here you can switch between different subscription plans.
|
||||
</p>
|
||||
<p>
|
||||
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 <a
|
||||
href="https://www.patreon.com/settings/memberships/nova"
|
||||
target="_blank">on Patreon</a>.
|
||||
</p>
|
||||
<p>
|
||||
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) => {
|
||||
<SuccessMessage bind:this={success_message}/>
|
||||
|
||||
<div class="feat_table">
|
||||
<div>
|
||||
<div class="feat_label" class:feat_highlight={subscription_type === "patreon"}>
|
||||
Patreon<br/>
|
||||
{#if subscription_type === "patreon"}
|
||||
Currently active<br/>
|
||||
<a class="button" href="https://www.patreon.com/settings/memberships/nova" target="_blank">
|
||||
<i class="icon">settings</i>
|
||||
Manage
|
||||
</a>
|
||||
{:else}
|
||||
<a class="button" href="/api/patreon_auth/start">
|
||||
<i class="icon">add_link</i>
|
||||
Link Patreon
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="feat_normal round_tr" class:feat_highlight={subscription_type === "patreon"}>
|
||||
<p>
|
||||
This subscription is managed by Patreon. You will need to <a
|
||||
href="https://www.patreon.com/nova/membership"
|
||||
target="_blank">purchase a plan on Patreon</a> before you
|
||||
can activate this subscription. After your purchase you can
|
||||
click the "Link Patreon" button and your account will be
|
||||
upgraded.
|
||||
</p>
|
||||
<ul>
|
||||
<li>€4 per month</li>
|
||||
<li>No storage limit for file sharing</li>
|
||||
<li>4 TB transfer limit (higher plans available)</li>
|
||||
<li>Access to the <a href="/filesystem">filesystem</a></li>
|
||||
<li>2 TB filesytem storage limit (higher plans available)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="feat_label" class:feat_highlight={subscription === "prepaid"}>
|
||||
Prepaid<br/>
|
||||
@@ -141,11 +98,7 @@ const update = async (plan: string) => {
|
||||
<div class="feat_normal round_tr" class:feat_highlight={subscription === "prepaid"}>
|
||||
<p>
|
||||
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 <a
|
||||
href="https://www.patreon.com/settings/memberships/nova"
|
||||
target="_blank">on Patreon.com</a>.
|
||||
plan. The plan deactivates when your credit runs out.
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
@@ -157,12 +110,12 @@ const update = async (plan: string) => {
|
||||
</li>
|
||||
<li>
|
||||
€1 per TB for data transfer (with <a
|
||||
href="/user/sharing/bandwidth">hotlinking</a>
|
||||
href="/user/sharing">hotlinking</a>
|
||||
enabled)
|
||||
</li>
|
||||
<li>
|
||||
File <a href="/user/sharing/embedding">embedding
|
||||
control</a> options
|
||||
File <a href="/user/sharing">embedding control</a>
|
||||
options
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -177,8 +130,8 @@ const update = async (plan: string) => {
|
||||
</div>
|
||||
<div class="feat_normal round_br" class:feat_highlight={subscription === ""}>
|
||||
<ul>
|
||||
<li>Standard free plan, files expire after 120 days.</li>
|
||||
<li>Download limit of 6 GB per day</li>
|
||||
<li>Storage limit: 50 GB</li>
|
||||
<li>Download limit: 50 GB per 30 days (sliding window)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,6 +58,6 @@ onMount(async () => {
|
||||
<br/><br/>
|
||||
|
||||
Egress used (30 days):
|
||||
(<a href="/user/sharing/bandwidth">set custom limit</a>)
|
||||
(<a href="/user/sharing">set custom limit</a>)
|
||||
<HotlinkProgressBar used={transfer_used} total={transfer_cap}></HotlinkProgressBar>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user