diff --git a/frontend/src/js/config.js b/frontend/src/js/config.js index 76946abbf..e6d44fd44 100644 --- a/frontend/src/js/config.js +++ b/frontend/src/js/config.js @@ -2,7 +2,6 @@ import * as DB from "./db"; import * as Sound from "./controllers/sound-controller"; import * as OutOfFocus from "./test/out-of-focus"; import * as Notifications from "./elements/notifications"; -import * as BackgroundFilter from "./elements/custom-background-filter"; import LayoutList from "./test/layouts"; export let localStorageConfig = null; @@ -1240,8 +1239,6 @@ export function setCustomBackgroundSize(value, nosave) { export function setCustomBackgroundFilter(array, nosave) { config.customBackgroundFilter = array; - BackgroundFilter.loadConfig(config.customBackgroundFilter); - BackgroundFilter.apply(); if (!nosave) saveToLocalStorage(); dispatchEvent("customBackgroundFilter", config.customBackgroundFilter); } diff --git a/frontend/src/js/elements/custom-background-filter.js b/frontend/src/js/elements/custom-background-filter.js index a90a4122a..aa3940bd2 100644 --- a/frontend/src/js/elements/custom-background-filter.js +++ b/frontend/src/js/elements/custom-background-filter.js @@ -122,3 +122,12 @@ $(".section.customBackgroundFilter .save.button").click((e) => { UpdateConfig.setCustomBackgroundFilter(arr, false); Notifications.add("Custom background filters saved", 1); }); + +$(document).ready(() => { + UpdateConfig.subscribeToEvent((eventKey, eventValue) => { + if (eventKey === "customBackgroundFilter") { + loadConfig(eventValue); + apply(); + } + }); +});