Add path to bookmarks, add logout button
This commit is contained in:
@@ -7,6 +7,7 @@ import FileOptions from "./FileOptions.svelte";
|
||||
import SharingOptions from "./SharingOptions.svelte";
|
||||
import AccessControl from "./AccessControl.svelte";
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import { loading_finish, loading_start } from "lib/Loading";
|
||||
|
||||
export let nav: FSNavigator
|
||||
let file: FSNode = {} as FSNode
|
||||
@@ -64,7 +65,7 @@ const save = async (keep_editing = false) => {
|
||||
|
||||
let new_file: FSNode
|
||||
try {
|
||||
nav.set_loading(true)
|
||||
loading_start()
|
||||
options.branding_enabled = JSON.stringify(branding_enabled)
|
||||
|
||||
new_file = await fs_update(file.path, options)
|
||||
@@ -88,7 +89,7 @@ const save = async (keep_editing = false) => {
|
||||
}
|
||||
return
|
||||
} finally {
|
||||
nav.set_loading(false)
|
||||
loading_finish()
|
||||
}
|
||||
|
||||
if (open_after_edit) {
|
||||
|
@@ -3,6 +3,7 @@ import Button from "layout/Button.svelte";
|
||||
import { fs_delete_all, type FSNode } from "lib/FilesystemAPI";
|
||||
import PathLink from "filesystem/util/PathLink.svelte";
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import { loading_finish, loading_start } from "lib/Loading";
|
||||
|
||||
export let nav: FSNavigator
|
||||
export let file: FSNode = {} as FSNode
|
||||
@@ -16,14 +17,14 @@ const delete_file = async (e: MouseEvent) => {
|
||||
e.preventDefault()
|
||||
|
||||
try {
|
||||
nav.set_loading(true)
|
||||
loading_start()
|
||||
await fs_delete_all(file.path)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
alert(err)
|
||||
return
|
||||
} finally {
|
||||
nav.set_loading(false)
|
||||
loading_finish()
|
||||
}
|
||||
|
||||
if (open_after_edit) {
|
||||
|
Reference in New Issue
Block a user