mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-06 01:46:35 +00:00
Fixed duplicate workspaces (closes #1196)
This commit is contained in:
Submodule src/browser/base/content/zen-components updated: ddf84fa3df...9a5efb4a87
@@ -314,7 +314,32 @@ var gZenLooksAndFeel = {
|
|||||||
|
|
||||||
var gZenWorkspacesSettings = {
|
var gZenWorkspacesSettings = {
|
||||||
init() {
|
init() {
|
||||||
|
Services.prefs.addObserver("zen.workspaces.enabled", this);
|
||||||
|
window.addEventListener("unload", () => {
|
||||||
|
Services.prefs.removeObserver("zen.workspaces.enabled", this);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async observe(subject, topic, data) {
|
||||||
|
await this.onWorkspaceChange(Services.prefs.getBoolPref("zen.workspaces.enabled"));
|
||||||
|
},
|
||||||
|
|
||||||
|
async onWorkspaceChange(checked) {
|
||||||
|
if (checked) {
|
||||||
|
let buttonIndex = await confirmRestartPrompt(
|
||||||
|
true,
|
||||||
|
1,
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
if (buttonIndex == CONFIRM_RESTART_PROMPT_RESTART_NOW) {
|
||||||
|
Services.startup.quit(
|
||||||
|
Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var gZenCKSSettings = {
|
var gZenCKSSettings = {
|
||||||
|
Reference in New Issue
Block a user