From cced19e2d1d0d744f018134904f98a03f15db09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Luba=C5=84ski?= Date: Tue, 17 Dec 2024 09:55:24 +0100 Subject: [PATCH] Add devtools switch --- src/background/devtools.js | 2 ++ src/pages/settings/components/devtools.js | 20 ++++++++++++++++++-- src/store/config.js | 15 ++++++++++----- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/background/devtools.js b/src/background/devtools.js index bad5c8435..7d5ab392e 100644 --- a/src/background/devtools.js +++ b/src/background/devtools.js @@ -13,6 +13,7 @@ import { store } from 'hybrids'; import DailyStats from '/store/daily-stats'; import Options from '/store/options.js'; +import Config from '/store/config.js'; import { deleteDatabases } from '/utils/indexeddb.js'; @@ -33,6 +34,7 @@ chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => { try { store.clear(Options); store.clear(DailyStats); + store.clear(Config); } catch (e) { console.error('[devtools] Error clearing store cache:', e); } diff --git a/src/pages/settings/components/devtools.js b/src/pages/settings/components/devtools.js index 49c1efb92..01cd9ae45 100644 --- a/src/pages/settings/components/devtools.js +++ b/src/pages/settings/components/devtools.js @@ -12,6 +12,7 @@ import { html, store, dispatch } from 'hybrids'; import Options from '/store/options.js'; +import Config from '/store/config.js'; const VERSION = chrome.runtime.getManifest().version; @@ -60,6 +61,7 @@ function refresh(host) { export default { counter: 0, options: store(Options), + config: store(Config), updatedAt: ({ options }) => store.ready(options) && options.filtersUpdatedAt && @@ -74,15 +76,29 @@ export default { }, ), visible: false, - render: ({ visible, counter, updatedAt }) => html` + render: ({ visible, counter, updatedAt, config }) => html`