Merge pull request #1818 from github/koesie10/fix-duplicate-webviews-error
Close serialized webview when another view already exists
This commit is contained in:
@@ -13,6 +13,7 @@ export interface VariantAnalysisViewManager<
|
||||
> {
|
||||
registerView(view: T): void;
|
||||
unregisterView(view: T): void;
|
||||
getView(variantAnalysisId: number): T | undefined;
|
||||
|
||||
getVariantAnalysis(
|
||||
variantAnalysisId: number,
|
||||
|
||||
@@ -38,6 +38,15 @@ export class VariantAnalysisViewSerializer implements WebviewPanelSerializer {
|
||||
|
||||
const manager = await this.waitForExtensionFullyLoaded();
|
||||
|
||||
const existingView = manager.getView(
|
||||
variantAnalysisState.variantAnalysisId,
|
||||
);
|
||||
if (existingView) {
|
||||
await existingView.openView();
|
||||
webviewPanel.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
const view = new VariantAnalysisView(
|
||||
this.ctx,
|
||||
variantAnalysisState.variantAnalysisId,
|
||||
|
||||
Reference in New Issue
Block a user