From 3007cddce92f68cbcb8ee0726bba4d23c62caba3 Mon Sep 17 00:00:00 2001 From: Argn0 Date: Tue, 24 May 2022 10:04:56 +0200 Subject: [PATCH 1/3] add reset settings option --- public/_locales/en/messages.json | 9 +++++++++ public/options/options.html | 8 ++++++++ src/config.ts | 8 +++++++- src/options.ts | 20 +++++++++++++++----- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index c2782048..11a3d609 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -947,5 +947,14 @@ }, "openOptionsPage": { "message": "Open options page" + }, + "resetToDefault": { + "message": "Reset to default" + }, + "confirmResetToDefault": { + "message": "Are you sure you want to reset all settings to their default values? This cannot be undone." + }, + "whatResetToDefault": { + "message": "This resets all settings to their default values." } } diff --git a/public/options/options.html b/public/options/options.html index 4f2bd730..2d6885bb 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -368,6 +368,14 @@ +
+
+ __MSG_resetToDefault__ +
+ +
__MSG_whatResetToDefault__
+
+ From d992cc7a3c621f435ac01544697ed57f77eccc60 Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 24 May 2022 12:55:17 -0400 Subject: [PATCH 3/3] Don't reset everything --- src/config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 52c9f45a..03ebbaf0 100644 --- a/src/config.ts +++ b/src/config.ts @@ -525,7 +525,13 @@ function addDefaults() { } function resetToDefault() { - chrome.storage.sync.set(Config.syncDefaults); + chrome.storage.sync.set({ + ...Config.syncDefaults, + userID: Config.config.userID, + minutesSaved: Config.config.minutesSaved, + skipCount: Config.config.skipCount, + sponsorTimesContributed: Config.config.sponsorTimesContributed + }); } // Sync config