Skip to content

Commit

Permalink
VSX: Keep Recently Uninstalled Extensions in View
Browse files Browse the repository at this point in the history
What It Does

- Keeps recently uninstalled extensions present in the `installed` part
  of the extensions-view until reload

How To Test

1. Open the extensions view.
2. Select an extension and click `Uninstall`.
3. Observe that the extension remains in the `installed` part of the view and can be re-installed if needed.
4. Reload the view and observe that the recently uninstalled extension has been removed.

Signed-off-by: seantan22 <[email protected]>
  • Loading branch information
seantan22 authored and vince-fugnitto committed Apr 5, 2021
1 parent 3381872 commit 221d90e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vsx-registry/src/browser/vsx-extensions-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,25 @@ export class VSXExtensionsModel {
}

protected async updateInstalled(): Promise<void> {
const prevInstalled = this._installed;
return this.doChange(async () => {
const plugins = this.pluginSupport.plugins;
const installed = new Set<string>();
const currInstalled = new Set<string>();
const refreshing = [];
for (const plugin of plugins) {
if (plugin.model.engine.type === 'vscode') {
const id = plugin.model.id;
this._installed.delete(id);
const extension = this.setExtension(id);
installed.add(extension.id);
currInstalled.add(extension.id);
refreshing.push(this.refresh(id));
}
}
for (const id of this._installed) {
refreshing.push(this.refresh(id));
}
Promise.all(refreshing);
const installed = new Set([...prevInstalled, ...currInstalled]);
const installedSorted = Array.from(installed).sort((a, b) => this.compareExtensions(a, b));
this._installed = new Set(installedSorted.values());
});
Expand Down

0 comments on commit 221d90e

Please sign in to comment.