From 6b96227e756b525ed3de99b117023d7ab8004bc6 Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Thu, 14 Dec 2023 11:38:15 +0100 Subject: [PATCH] lets it save after restart/rejoin lets it save after restart/rejoin --- ui/src/components/Main.svelte | 3 ++- ui/src/components/Menu.svelte | 13 ++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) 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() {