1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-19 06:14:04 +00:00

First commit in a long time

This commit is contained in:
2023-05-26 17:21:39 +02:00
parent b15fde11db
commit a84b1498a3
17 changed files with 321 additions and 87 deletions

View File

@ -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;