diff --git a/ui/src/components/Main.svelte b/ui/src/components/Main.svelte index b98081ca..ffed2657 100644 --- a/ui/src/components/Main.svelte +++ b/ui/src/components/Main.svelte @@ -5,7 +5,8 @@ import { timeAgo } from '@utils/timeAgo'; let notifications = []; - + $IS_RIGHT_MARGIN = localStorage.getItem('IsRightMargin') === 'true'; + DISPATCH.subscribe(value => { notifications = value || []; }); diff --git a/ui/src/components/Menu.svelte b/ui/src/components/Menu.svelte index c8f2217c..1deba6c9 100644 --- a/ui/src/components/Menu.svelte +++ b/ui/src/components/Menu.svelte @@ -6,7 +6,8 @@ let activeCallId = null; let additionalUnitsVisible = {}; - + $IS_RIGHT_MARGIN = localStorage.getItem('IsRightMargin') === 'true'; + function toggleDispatch(id) { if (activeCallId === id) { activeCallId = null; @@ -35,8 +36,14 @@ } function toggleMargin() { - $IS_RIGHT_MARGIN = !$IS_RIGHT_MARGIN; - + if ($IS_RIGHT_MARGIN) { + localStorage.setItem('IsRightMargin', 'false'); + } else { + localStorage.setItem('IsRightMargin', 'true'); + } + + $IS_RIGHT_MARGIN = localStorage.getItem('IsRightMargin') === 'true'; + } function toggleMute() {