diff --git a/frontend/src/lib/progress.js b/frontend/src/lib/progress.js new file mode 100644 index 0000000..311a44a --- /dev/null +++ b/frontend/src/lib/progress.js @@ -0,0 +1,16 @@ +import { StartProgressBar, StopProgressBar } from '$wails/go/ui/UI'; + +let taskCounter = 0; + +export function startProgress(taskDescription = 'Loading…') { + const taskIndex = ++taskCounter; + StartProgressBar(taskIndex, taskDescription); + + const task = { + id: taskIndex, + description: taskDescription, + end: () => StopProgressBar(taskIndex), + }; + + return task; +} diff --git a/frontend/src/lib/stores/busy.js b/frontend/src/lib/stores/busy.js deleted file mode 100644 index caf6655..0000000 --- a/frontend/src/lib/stores/busy.js +++ /dev/null @@ -1,33 +0,0 @@ -import { StartProgressBar, StopProgressBar } from '$wails/go/ui/UI'; -import { writable } from 'svelte/store'; - -const { update, subscribe } = writable(0); - -let timer; -let progressBarShown = false; -subscribe(isBusy => { - if (isBusy) { - document.body.classList.add('busy'); - if (!progressBarShown) { - progressBarShown = true; - timer = setTimeout(() => StartProgressBar(''), 100); - } - } - else { - if (timer) { - clearTimeout(timer); - timer = undefined; - } - progressBarShown = false; - document.body.classList.remove('busy'); - StopProgressBar(); - } -}); - -const busy = { - start: () => update(v => ++v), - end: () => update(v => --v), - subscribe, -}; - -export default busy; diff --git a/frontend/src/organisms/connection/collection/components/export.svelte b/frontend/src/organisms/connection/collection/components/export.svelte new file mode 100644 index 0000000..2cbee99 --- /dev/null +++ b/frontend/src/organisms/connection/collection/components/export.svelte @@ -0,0 +1,61 @@ + + + +
+ + + +
+
+ + diff --git a/frontend/src/organisms/connection/collection/find.svelte b/frontend/src/organisms/connection/collection/find.svelte index 045235b..5c9dd1a 100644 --- a/frontend/src/organisms/connection/collection/find.svelte +++ b/frontend/src/organisms/connection/collection/find.svelte @@ -1,19 +1,18 @@ diff --git a/frontend/src/organisms/connection/index.svelte b/frontend/src/organisms/connection/index.svelte index 2c924dd..1a969f2 100644 --- a/frontend/src/organisms/connection/index.svelte +++ b/frontend/src/organisms/connection/index.svelte @@ -1,5 +1,5 @@