private readonly callbackOpen: CallbackOpen;
private readonly container: PageMenuContainer;
private readonly legacyUserPanels = new Map<Tab, LegacyUserPanelApi>();
+ private readonly observer: MutationObserver;
private readonly userMenuProviders = new Map<Tab, UserMenuProvider>();
private readonly tabOrigins = new Map<HTMLElement, HTMLElement>();
private readonly tabPanels = new Map<Tab, HTMLElement>();
match: () => this.detachViewsFromPanel(),
unmatch: () => this.detachViewsFromPanel(),
});
+
+ this.observer = new MutationObserver(() => {
+ this.refreshTabUnreadIndicators();
+ });
}
enable(): void {
this.attachViewToPanel(tab);
this.activeTab = tab;
+ this.observer.observe(tabPanel, {
+ attributeFilter: ["data-is-unread"],
+ childList: true,
+ subtree: true,
+ });
}
private closeActiveTab(): void {
legacyPanel.close();
}
+ this.observer.disconnect();
this.refreshTabUnreadIndicators();
}
match: () => this.detachViewsFromPanel(),
unmatch: () => this.detachViewsFromPanel(),
});
+ this.observer = new MutationObserver(() => {
+ this.refreshTabUnreadIndicators();
+ });
}
enable() {
this.userMenu.setAttribute("aria-expanded", "false");
}
this.attachViewToPanel(tab);
this.activeTab = tab;
+ this.observer.observe(tabPanel, {
+ attributeFilter: ["data-is-unread"],
+ childList: true,
+ subtree: true,
+ });
}
closeActiveTab() {
if (!this.activeTab) {
if (legacyPanel) {
legacyPanel.close();
}
+ this.observer.disconnect();
this.refreshTabUnreadIndicators();
}
attachViewToPanel(tab) {