mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:49:59 +02:00
fix(workspaces): Ensure ZenWorkspacesEngine is registered only once
This commit prevents multiple registrations of the `ZenWorkspacesEngine`. Previously, the `ZenWorkspacesEngine` was registered unconditionally every time `ZenWorkspaces` was initialized. This could lead to issues if the engine was already registered. This commit adds a check to ensure that the engine is only registered if it is not already present. This prevents multiple registrations and ensures that the engine is only initialized once.
This commit is contained in:
parent
0d161326ef
commit
b28ca11e57
1 changed files with 3 additions and 1 deletions
|
@ -19,7 +19,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
);
|
||||
ChromeUtils.defineLazyGetter(this, 'tabContainer', () => document.getElementById('tabbrowser-tabs'));
|
||||
await ZenWorkspacesStorage.init();
|
||||
Weave.Service.engineManager.register(ZenWorkspacesEngine);
|
||||
if(!Weave.Service.engineManager.get("workspaces")) {
|
||||
Weave.Service.engineManager.register(ZenWorkspacesEngine);
|
||||
}
|
||||
await this.initializeWorkspaces();
|
||||
console.info('ZenWorkspaces: ZenWorkspaces initialized');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue