Update settings-page.js

Fixed warning toggle
This commit is contained in:
Kenneth Hendricks 2024-11-08 17:24:13 -05:00 committed by GitHub
parent 65216472c9
commit d4e648f801
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}
}