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