Skip to content

Commit

Permalink
Makes Launchpad View responsive to launchpad provider changes
Browse files Browse the repository at this point in the history
  • Loading branch information
axosoft-ramint committed Nov 4, 2024
1 parent 14b115a commit 4967dfe
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/views/launchpadView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ContextValues, getViewNodeId } from './nodes/abstract/viewNode';
import type { GroupingNode } from './nodes/groupingNode';
import { LaunchpadViewGroupingNode } from './nodes/launchpadViewGroupingNode';
import { getPullRequestChildren, getPullRequestTooltip } from './nodes/pullRequestNode';
import { ViewBase } from './viewBase';
import { disposeChildren, ViewBase } from './viewBase';
import { registerViewCommand } from './viewCommands';

export class LaunchpadItemNode extends CacheableChildrenViewNode<'launchpad-item', LaunchpadView> {
Expand Down Expand Up @@ -121,8 +121,23 @@ export class LaunchpadViewNode extends CacheableChildrenViewNode<
LaunchpadView,
GroupingNode | LaunchpadItemNode
> {
private disposable: Disposable;

constructor(view: LaunchpadView) {
super('launchpad', unknownGitUri, view);
this.disposable = Disposable.from(this.view.container.launchpad.onDidChange(this.refresh, this));
}

override dispose() {
this.disposable?.dispose();
super.dispose();
}

override refresh() {
if (this.children == null) return;

disposeChildren(this.children);
this.children = undefined;
}

async getChildren(): Promise<(GroupingNode | LaunchpadItemNode)[]> {
Expand Down

0 comments on commit 4967dfe

Please sign in to comment.