24 lines
693 B
TypeScript
24 lines
693 B
TypeScript
import { writable } from "svelte/store";
|
|
import Timeout = NodeJS.Timeout;
|
|
|
|
export const menuIconVisible = writable(false);
|
|
|
|
let warningContainerTimeout: Timeout | null = null;
|
|
function createWarningContainerStore() {
|
|
const { subscribe, set } = writable<boolean>(false);
|
|
|
|
return {
|
|
subscribe,
|
|
activateWarningContainer() {
|
|
set(true);
|
|
if (warningContainerTimeout) clearTimeout(warningContainerTimeout);
|
|
warningContainerTimeout = setTimeout(() => {
|
|
set(false);
|
|
warningContainerTimeout = null;
|
|
}, 120000);
|
|
},
|
|
};
|
|
}
|
|
|
|
export const warningContainerStore = createWarningContainerStore();
|