Change filesystem navigator into a class with a svelte store implementation

This commit is contained in:
2024-08-09 13:02:07 +02:00
parent c481a89051
commit 69744e41a6
28 changed files with 534 additions and 530 deletions

View File

@@ -9,7 +9,7 @@ import SharingOptions from "./SharingOptions.svelte";
let dispatch = createEventDispatcher()
export let fs_navigator
export let nav
let file = {
path: "",
name: "",
@@ -117,9 +117,9 @@ const save = async (keep_editing = false) => {
}
if (open_after_edit) {
fs_navigator.navigate(file.path, false)
nav.navigate(file.path, false)
} else {
fs_navigator.reload()
nav.reload()
}
if (keep_editing) {
@@ -149,7 +149,7 @@ const save = async (keep_editing = false) => {
<div class="tab_content">
{#if tab === "file"}
<FileOptions
fs_navigator={fs_navigator}
nav={nav}
bind:file
bind:new_name
bind:visible

View File

@@ -5,7 +5,7 @@ import { fs_delete_all } from "../FilesystemAPI";
import PathLink from "../util/PathLink.svelte";
let dispatch = createEventDispatcher()
export let fs_navigator
export let nav
export let file = {}
export let new_name
export let visible
@@ -28,9 +28,9 @@ const delete_file = async e => {
}
if (open_after_edit) {
fs_navigator.navigate(file.path, false)
nav.navigate(file.path, false)
} else {
fs_navigator.reload()
nav.reload()
}
visible = false
}
@@ -42,7 +42,7 @@ const delete_file = async e => {
<div class="highlight_yellow">
Filesystem root cannot be renamed. If this shared directory
is in
<PathLink nav={fs_navigator} path="/me">your filesystem</PathLink>
<PathLink nav={nav} path="/me">your filesystem</PathLink>
you can rename it from there
</div>
{/if}