From d4e648f801d6de29c59f5a21dfcc06a46523c6b2 Mon Sep 17 00:00:00 2001 From: Kenneth Hendricks <50819541+kenhendricks00@users.noreply.github.com> Date: Fri, 8 Nov 2024 17:24:13 -0500 Subject: [PATCH] Update settings-page.js Fixed warning toggle --- src/pub/settings-page.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pub/settings-page.js b/src/pub/settings-page.js index 978f4ff..6ffcf83 100644 --- a/src/pub/settings-page.js +++ b/src/pub/settings-page.js @@ -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); } }