fix toggle + fix seqta toggle not responsive

This commit is contained in:
Crazypersonalph
2023-12-07 13:14:41 +08:00
parent 03ab5f0cdc
commit 292659828e
6 changed files with 24 additions and 2 deletions
+3
View File
@@ -14,3 +14,6 @@ dist/
# Sentry Config File # Sentry Config File
.env.sentry-build-plugin .env.sentry-build-plugin
# Sentry Config File
.env.sentry-build-plugin
+3
View File
@@ -4,3 +4,6 @@
# Sentry Config File # Sentry Config File
.env.sentry-build-plugin .env.sentry-build-plugin
# Sentry Config File
.env.sentry-build-plugin
+1 -1
View File
@@ -16,7 +16,7 @@ export const SettingsContextProvider: React.FC<{ children: ReactNode }> = ({ chi
const [settingsState, setSettingsState] = useState<SettingsState>({ const [settingsState, setSettingsState] = useState<SettingsState>({
notificationCollector: false, notificationCollector: false,
lessonAlerts: false, lessonAlerts: false,
telemetry: true, telemetry: false,
animatedBackground: false, animatedBackground: false,
animatedBackgroundSpeed: "0", animatedBackgroundSpeed: "0",
customThemeColor: "rgba(219, 105, 105, 1)", customThemeColor: "rgba(219, 105, 105, 1)",
-1
View File
@@ -371,7 +371,6 @@ export function RemoveBackground() {
bk[0].remove(); bk[0].remove();
bk2[0].remove(); bk2[0].remove();
bk3[0].remove(); bk3[0].remove();
console.log('it deleted???')
} }
export function waitForElm(selector: any) { export function waitForElm(selector: any) {
+1
View File
@@ -152,6 +152,7 @@ function GetNews(sendResponse: any) {
const DefaultValues: any = { const DefaultValues: any = {
onoff: true, onoff: true,
animatedbk: true, animatedbk: true,
telemetry: false,
bksliderinput: 50, bksliderinput: 50,
transparencyEffects: false, transparencyEffects: false,
lessonalert: true, lessonalert: true,
+16
View File
@@ -28,6 +28,14 @@ export default class StorageListener {
this.handleSelectedColorChange(changes.selectedColor.newValue); this.handleSelectedColorChange(changes.selectedColor.newValue);
break; break;
case 'telemetry':
this.handleTelemetryChange();
break;
case 'onoff':
this.handleOnOffChange();
break;
case 'shortcuts': case 'shortcuts':
this.handleShortcutsChange( this.handleShortcutsChange(
changes.shortcuts.oldValue, 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) { handleNotificationCollectorChange(details: any) {
if (details.newValue) { if (details.newValue) {
enableNotificationCollector(); enableNotificationCollector();