From 9174307be07e4d7a1c8a833691ca2ef3f3086a85 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Fri, 23 Apr 2021 11:11:58 +0400 Subject: [PATCH] Fix applying background blur --- src/components/sidebarLeft/tabs/background.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/sidebarLeft/tabs/background.ts b/src/components/sidebarLeft/tabs/background.ts index 34a3a08b..7a965fb6 100644 --- a/src/components/sidebarLeft/tabs/background.ts +++ b/src/components/sidebarLeft/tabs/background.ts @@ -49,6 +49,7 @@ export default class AppBackgroundTab extends SliderSuperTab { theme.background = copy(defaultTheme.background); appStateManager.pushToState('settings', rootScope.settings); appImManager.applyCurrentTheme(undefined, undefined, true); + blurCheckboxField.setValueSilently(theme.background.blur); } }, {listenerSetter: this.listenerSetter}); @@ -61,12 +62,12 @@ export default class AppBackgroundTab extends SliderSuperTab { }); this.listenerSetter.add(blurCheckboxField.input, 'change', () => { - const active = grid.querySelector('.active') as HTMLElement; - if(!active) return; - theme.background.blur = blurCheckboxField.input.checked; appStateManager.pushToState('settings', rootScope.settings); + const active = grid.querySelector('.active') as HTMLElement; + if(!active) return; + // * wait for animation end setTimeout(() => { setBackgroundDocument(active.dataset.slug, appDocsManager.getDoc(active.dataset.docId));