diff --git a/frontend/src/components/editors/directorychooser.svelte b/frontend/src/components/editors/directorychooser.svelte index 050ad61..443a9aa 100644 --- a/frontend/src/components/editors/directorychooser.svelte +++ b/frontend/src/components/editors/directorychooser.svelte @@ -1,12 +1,12 @@ diff --git a/frontend/src/lib/progress.js b/frontend/src/lib/progress.js deleted file mode 100644 index af6f37e..0000000 --- a/frontend/src/lib/progress.js +++ /dev/null @@ -1,27 +0,0 @@ -import { StartProgressBar, StopProgressBar } from '$wails/go/ui/UI.js'; - -let taskCounter = 0; - -export function startProgress(taskDescription = 'Loading…') { - const taskIndex = ++taskCounter; - let started = false; - - const debouncer = setTimeout(() => { - StartProgressBar(taskIndex, taskDescription); - started = true; - }, 150); - - const task = { - id: taskIndex, - description: taskDescription, - - end: () => { - clearTimeout(debouncer); - if (started) { - StopProgressBar(taskIndex); - } - }, - }; - - return task; -} diff --git a/frontend/src/lib/stores/hosttree.js b/frontend/src/lib/stores/hosttree.js index f3cfa62..bf1d9de 100644 --- a/frontend/src/lib/stores/hosttree.js +++ b/frontend/src/lib/stores/hosttree.js @@ -1,5 +1,4 @@ import dialogs from '$lib/dialogs.js'; -import { startProgress } from '$lib/progress.js'; import { get, writable } from 'svelte/store'; import applicationInited from './inited.js'; import queries from './queries.js'; @@ -40,7 +39,10 @@ async function refresh() { const hosts = await Hosts(); const hostTree = getValue(); - for (const [ hostKey, hostDetails ] of Object.entries(hosts)) { + for (const [ + hostKey, + hostDetails, + ] of Object.entries(hosts)) { hostTree[hostKey] = hostTree[hostKey] || {}; const host = hostTree[hostKey]; host.key = hostKey; @@ -70,7 +72,10 @@ async function refresh() { host.databases[dbKey] = host.databases[dbKey] || {}; } - for (const [ dbKey, database ] of Object.entries(host.databases)) { + for (const [ + dbKey, + database, + ] of Object.entries(host.databases)) { if (!database.new && !dbNames.includes(dbKey)) { delete host.databases[dbKey]; continue; @@ -95,7 +100,10 @@ async function refresh() { database.collections[collKey] = database.collections[collKey] || {}; } - for (const [ collKey, collection ] of Object.entries(database.collections)) { + for (const [ + collKey, + collection, + ] of Object.entries(database.collections)) { if (!collection.new && !collNames.includes(collKey)) { delete database.collections[collKey]; continue; @@ -121,13 +129,8 @@ async function refresh() { collection.rename = async function() { const newCollKey = await dialogs.enterText('Rename collection', `Enter a new name for collection ${collKey}.`, collKey); if (newCollKey && (newCollKey !== collKey)) { - const progress = startProgress( - `Renaming collection "${collKey}" to "${newCollKey}"…` - ); - const ok = await RenameCollection(hostKey, dbKey, collKey, newCollKey); await database.open(); - progress.end(); return ok; } }; diff --git a/frontend/src/organisms/connection/collection/find.svelte b/frontend/src/organisms/connection/collection/find.svelte index 7b24f93..725e178 100644 --- a/frontend/src/organisms/connection/collection/find.svelte +++ b/frontend/src/organisms/connection/collection/find.svelte @@ -6,7 +6,6 @@ import input from '$lib/actions/input.js'; import dialogs from '$lib/dialogs.js'; import { deepClone } from '$lib/objects.js'; - import { startProgress } from '$lib/progress.js'; import applicationSettings from '$lib/stores/settings.js'; import views from '$lib/stores/views.js'; import { convertLooseJson, stringCouldBeID } from '$lib/strings.js'; @@ -178,7 +177,6 @@ } async function saveDocument(event) { - const progress = startProgress('Performing update…'); const success = await UpdateFoundDocument( collection.hostKey, collection.dbKey, @@ -191,8 +189,6 @@ objectViewerSuccessMessage = 'Document has been saved!'; submitQuery(); } - - progress.end(); } $: collection && refresh(); @@ -344,7 +340,10 @@