mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 01:20:00 +02:00
feat(workspaces): Refresh workspace strip after sync completion
This commit adds an observer for the `weave:engine:sync:finish` event and clears the workspace cache when the workspace sync is complete. This ensures that the workspace strip is updated with the latest data after a sync.
This commit is contained in:
parent
187dece11c
commit
4a54adea9a
1 changed files with 14 additions and 0 deletions
|
@ -22,6 +22,20 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
Weave.Service.engineManager.register(ZenWorkspacesEngine);
|
||||
await this.initializeWorkspaces();
|
||||
console.info('ZenWorkspaces: ZenWorkspaces initialized');
|
||||
|
||||
// Add observer for sync completion
|
||||
Services.obs.addObserver(this, "weave:engine:sync:finish");
|
||||
}
|
||||
|
||||
observe(subject, topic, data) {
|
||||
if (topic === "weave:engine:sync:finish" && data === "workspaces") {
|
||||
this._workspaceCache = null; // Clear cache to fetch fresh data
|
||||
this.updateWorkspaceStrip();
|
||||
}
|
||||
}
|
||||
|
||||
updateWorkspaceStrip() {
|
||||
this._propagateWorkspaceData().catch(console.error);
|
||||
}
|
||||
|
||||
get shouldHaveWorkspaces() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue