Skip to content

Commit

Permalink
Fixes an error with duplicate ids
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Feb 8, 2022
1 parent d247327 commit 58e4fb2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/views/nodes/autolinkedItemsNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ export interface FilesQueryResults {
};
}

let instanceId = 0;

export class AutolinkedItemsNode extends ViewNode<ViewsWithCommits> {
private _children: ViewNode[] | undefined;
private _instanceId: number;

constructor(
view: ViewsWithCommits,
Expand All @@ -31,10 +34,11 @@ export class AutolinkedItemsNode extends ViewNode<ViewsWithCommits> {
public readonly log: GitLog,
) {
super(GitUri.fromRepoPath(repoPath), view, parent);
this._instanceId = instanceId++;
}

override get id(): string {
return `${this.parent!.id}:results:autolinked`;
return `${this.parent!.id}:results:autolinked:${this._instanceId}`;
}

async getChildren(): Promise<ViewNode[]> {
Expand Down

0 comments on commit 58e4fb2

Please sign in to comment.