Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2090,10 +2090,18 @@ export default class VirtualFooterPlugin extends Plugin {
if (rule.renderLocation === RenderLocation.Sidebar && rule.showInSeparateTab) {
const viewId = this.getSeparateViewId(index);
const tabName = rule.sidebarTabName?.trim() ? `Virtual Content: ${rule.sidebarTabName}` : `Virtual Content: Rule ${index + 1}`;
this.registerView(
viewId,
(leaf) => new VirtualContentView(leaf, this, viewId, tabName, () => this.getSeparateTabContent(viewId))
);

try {
this.registerView(
viewId,
(leaf) => new VirtualContentView(leaf, this, viewId, tabName, () => this.getSeparateTabContent(viewId))
);
} catch (error) {
// Calling `this.registerView` when the view already exists, the following error occurs.
// This error doesn't need special handling, but if it is left unhandled, the Settings UI will not update properly.

// console.error(error) // `Error: Attempting to register an existing view type "virtual-content-separate-view-1"`
}
}
});
}
Expand Down