mirror of
https://github.com/fmhy/FMHY-SafeGuard.git
synced 2026-03-11 08:55:40 +00:00
Update settings-page.js
Fixed warning toggle
This commit is contained in:
parent
65216472c9
commit
d4e648f801
1 changed files with 13 additions and 1 deletions
|
|
@ -216,17 +216,29 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
updateFrequency: updateFrequency.value,
|
||||
};
|
||||
|
||||
console.log("Saving settings:", settings);
|
||||
|
||||
// Save settings to storage
|
||||
await browserAPI.storage.sync.set(settings);
|
||||
showNotification("Settings saved successfully!");
|
||||
applyTheme(settings.theme);
|
||||
await updateNextUpdateStatus();
|
||||
|
||||
console.log(
|
||||
"Settings saved to storage, sending message to background script..."
|
||||
);
|
||||
|
||||
// Send updated settings to background script
|
||||
await browserAPI.runtime.sendMessage({
|
||||
type: "settingsUpdated",
|
||||
settings: settings,
|
||||
});
|
||||
|
||||
console.log(
|
||||
"Settings update message sent to background script successfully."
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Error saving settings:", error);
|
||||
console.error("Error occurred during saveSettings:", error);
|
||||
showNotification("Error saving settings", true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue