From 55a25dc1ea922d5d3bc366bd66e4b4fb784c53d8 Mon Sep 17 00:00:00 2001 From: Svallinn <41585298+Svallinn@users.noreply.github.com> Date: Fri, 11 Jun 2021 02:33:36 +0100 Subject: [PATCH] Store/Settings: Handle `defaultVolume`'s side effects in the module --- src/renderer/store/modules/settings.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderer/store/modules/settings.js b/src/renderer/store/modules/settings.js index 12fc7612..8d47ed76 100644 --- a/src/renderer/store/modules/settings.js +++ b/src/renderer/store/modules/settings.js @@ -182,7 +182,6 @@ const state = { proxyVideos: false, defaultTheatreMode: false, defaultInterval: 5, - defaultVolume: 1, defaultPlayback: 1, defaultVideoFormat: 'dash', defaultQuality: '720', @@ -213,6 +212,13 @@ const state = { } const stateWithSideEffects = { + defaultVolume: { + defaultValue: 1, + sideEffectsHandler: (_, value) => { + sessionStorage.setItem('volume', value) + } + }, + uiScale: { defaultValue: 100, sideEffectsHandler: ({ state: { usingElectron } }, value) => {