From 5644ad7bc55cb68d9456557ac0f1c89aaf762ac1 Mon Sep 17 00:00:00 2001 From: Crazypersonalph <93847055+Crazypersonalph@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:14:41 +0800 Subject: [PATCH] fix toggle + fix seqta toggle not responsive --- .gitignore | 3 +++ interface/.gitignore | 3 +++ interface/src/SettingsContext.tsx | 2 +- src/SEQTA.ts | 1 - src/background.ts | 1 + src/seqta/utils/StorageListener.ts | 16 ++++++++++++++++ 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7e8d9883..57926556 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ dist/ # Sentry Config File .env.sentry-build-plugin + +# Sentry Config File +.env.sentry-build-plugin diff --git a/interface/.gitignore b/interface/.gitignore index 8adfcaab..3f74bee3 100644 --- a/interface/.gitignore +++ b/interface/.gitignore @@ -4,3 +4,6 @@ # Sentry Config File .env.sentry-build-plugin + +# Sentry Config File +.env.sentry-build-plugin diff --git a/interface/src/SettingsContext.tsx b/interface/src/SettingsContext.tsx index 5c0932c5..bd387b37 100644 --- a/interface/src/SettingsContext.tsx +++ b/interface/src/SettingsContext.tsx @@ -16,7 +16,7 @@ export const SettingsContextProvider: React.FC<{ children: ReactNode }> = ({ chi const [settingsState, setSettingsState] = useState({ notificationCollector: false, lessonAlerts: false, - telemetry: true, + telemetry: false, animatedBackground: false, animatedBackgroundSpeed: "0", customThemeColor: "rgba(219, 105, 105, 1)", diff --git a/src/SEQTA.ts b/src/SEQTA.ts index 2c38b009..6f0e9fbf 100644 --- a/src/SEQTA.ts +++ b/src/SEQTA.ts @@ -371,7 +371,6 @@ export function RemoveBackground() { bk[0].remove(); bk2[0].remove(); bk3[0].remove(); - console.log('it deleted???') } export function waitForElm(selector: any) { diff --git a/src/background.ts b/src/background.ts index cadce43e..c8b27030 100644 --- a/src/background.ts +++ b/src/background.ts @@ -152,6 +152,7 @@ function GetNews(sendResponse: any) { const DefaultValues: any = { onoff: true, animatedbk: true, + telemetry: false, bksliderinput: 50, transparencyEffects: false, lessonalert: true, diff --git a/src/seqta/utils/StorageListener.ts b/src/seqta/utils/StorageListener.ts index 48b07709..9111fc17 100644 --- a/src/seqta/utils/StorageListener.ts +++ b/src/seqta/utils/StorageListener.ts @@ -28,6 +28,14 @@ export default class StorageListener { this.handleSelectedColorChange(changes.selectedColor.newValue); break; + case 'telemetry': + this.handleTelemetryChange(); + break; + + case 'onoff': + this.handleOnOffChange(); + break; + case 'shortcuts': this.handleShortcutsChange( changes.shortcuts.oldValue, @@ -90,6 +98,14 @@ export default class StorageListener { } } + handleTelemetryChange() { + browser.runtime.sendMessage({ type: 'reloadTabs' }) + } + + handleOnOffChange() { + browser.runtime.sendMessage({ type: 'reloadTabs' }) + } + handleNotificationCollectorChange(details: any) { if (details.newValue) { enableNotificationCollector();