Remove the need to provide a bucket ID to each API call

This commit is contained in:
2023-05-30 15:51:10 +02:00
parent 2647a22c91
commit 0299b730a5
23 changed files with 95 additions and 96 deletions

View File

@@ -5,7 +5,6 @@ import { createEventDispatcher } from "svelte";
let dispatch = createEventDispatcher()
export let bucket = ""
export let fs_navigator
let file = {
path: "",
@@ -42,7 +41,6 @@ const save = async () => {
try {
dispatch("loading", true)
await fs_update(
bucket,
file.path,
{
shared: shared,
@@ -55,12 +53,16 @@ const save = async () => {
let parent = file.path.slice(0, -file.name.length)
console.log("Moving", file.path, "to", parent+file_name)
await fs_rename(bucket, file.path, parent+file_name)
await fs_rename(file.path, parent+file_name)
file.path = parent+file_name
}
} catch (err) {
console.error(err)
alert(err)
if (err.message) {
alert(err.message)
} else {
console.error(err)
alert(err)
}
return
} finally {
dispatch("loading", false)