Skip to content

Commit

Permalink
add/remove color categories on settings change
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschz committed Oct 28, 2023
1 parent 9ca48ef commit cc72a16
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/legacy/modules/gdataUI.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,21 @@ function register() {
},
});

let { doEnableColors, getMessenger } = ChromeUtils.import(
let { doEnableColors, doDisableColors, getMessenger } = ChromeUtils.import(
"resource://gdata-provider/legacy/modules/gdataUtils.jsm"
);

let enableColors = getMessenger().gdataSyncPrefs.get("settings.enableColors", false);

let messenger = getMessenger();
messenger.storage.onChanged.addListener((settings, _target) => {
if ("settings.enableColors" in settings) {
if (settings["settings.enableColors"].newValue) {
doEnableColors();
} else {
doDisableColors();
}
}
});
let enableColors = messenger.gdataSyncPrefs.get("settings.enableColors", false);
if (enableColors) {
doEnableColors();
}
Expand Down

0 comments on commit cc72a16

Please sign in to comment.