mirror of
https://github.com/mathuo/dockview
synced 2025-03-09 15:32:03 +00:00
disallow duplicate splitivew panels (identical ids)
This commit is contained in:
parent
e18c28856e
commit
e55355695e
@ -161,6 +161,10 @@ export class ComponentSplitview
|
||||
}
|
||||
|
||||
addPanel(options: AddSplitviewComponentOptions): void {
|
||||
if (this.panels.has(options.id)) {
|
||||
throw new Error(`panel ${options.id} already exists`);
|
||||
}
|
||||
|
||||
const view = createComponent(
|
||||
options.id,
|
||||
options.component,
|
||||
@ -259,6 +263,10 @@ export class ComponentSplitview
|
||||
views: views.map((view) => {
|
||||
const data = view.data;
|
||||
|
||||
if (this.panels.has(data.id)) {
|
||||
throw new Error(`panel ${data.id} already exists`);
|
||||
}
|
||||
|
||||
const panel = createComponent(
|
||||
data.id,
|
||||
data.component,
|
||||
|
Loading…
Reference in New Issue
Block a user