Skip to content

Commit

Permalink
sync nav-icons in plugin sidebar on tab location change
Browse files Browse the repository at this point in the history
  • Loading branch information
infacc committed Jul 5, 2023
1 parent 09014d8 commit f15ec57
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/app/components/plugin-sidebar/plugin-sidebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,24 @@ export class PluginSidebarComponent implements OnInit, OnDestroy {
const tabIndex = this.pluginGroups.findIndex(group => group.link.resourceKey?.['?template-tab'] === tabId);
this.pluginGroups[tabIndex] = { ...this.pluginGroups[tabIndex] };
const tabResponse = await this.registry.getByApiLink<TemplateTabApiObject>(changedObject.changed);
if (tabResponse) {
if (tabResponse == null) {
console.warn("Could not load template tab", changedObject.changed);
return;
}
if (tabIndex < 0) {
this.pluginGroups.push({
name: tabResponse.data.name,
open: false,
description: tabResponse.data.description,
link: tabResponse.data.plugins,
});
} else {
this.pluginGroups[tabIndex].name = tabResponse.data.name;
this.pluginGroups[tabIndex].description = tabResponse.data.description;
}
if (tabResponse.data.location !== 'workspace') {
this.pluginGroups.splice(tabIndex, 1);
}
});

// romove deleted template tabs
Expand Down

0 comments on commit f15ec57

Please sign in to comment.