From 8b7d9a8bf1322d7da696f8d8ba5e5fcd630fa172 Mon Sep 17 00:00:00 2001 From: buqiyuan <1743369777@qq.com> Date: Thu, 9 Feb 2023 19:01:30 +0800 Subject: [PATCH] fix: extension-tree select issue --- .../app/pages/extension/list/extension-list.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/workbench/browser/src/app/pages/extension/list/extension-list.component.ts b/src/workbench/browser/src/app/pages/extension/list/extension-list.component.ts index 33cef1c3d..d2c30992a 100644 --- a/src/workbench/browser/src/app/pages/extension/list/extension-list.component.ts +++ b/src/workbench/browser/src/app/pages/extension/list/extension-list.component.ts @@ -35,14 +35,18 @@ export class ExtensionListComponent implements OnInit { const notCompleteSuggest = suggestList.some(n => n.startsWith(this.keyword) && this.keyword !== n); if (notCompleteSuggest) return; } - + const originType = this.type; let type = this.type; if (type.startsWith(ContributionPointsPrefix.category)) { type = 'category'; this.category = this.type.slice(ContributionPointsPrefix.category.length); } this.extensionList = []; - this.extensionList = await this.searchPlugin(type, { keyword: this.keyword, category: this.category }); + const data = await this.searchPlugin(type, { keyword: this.keyword, category: this.category }); + // 避免频繁切换,导致侧边栏选中状态与右侧展示不一致 + if (originType === this.type) { + this.extensionList = data; + } }); } clickExtension(event: MouseEvent, item, nzSelectedIndex?) {