From 58e4fb2d138bb67d02f7518a8d725df041f84490 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 8 Feb 2022 03:02:11 -0500 Subject: [PATCH] Fixes an error with duplicate ids --- src/views/nodes/autolinkedItemsNode.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/nodes/autolinkedItemsNode.ts b/src/views/nodes/autolinkedItemsNode.ts index 3d3115e..048b0c4 100644 --- a/src/views/nodes/autolinkedItemsNode.ts +++ b/src/views/nodes/autolinkedItemsNode.ts @@ -20,8 +20,11 @@ export interface FilesQueryResults { }; } +let instanceId = 0; + export class AutolinkedItemsNode extends ViewNode { private _children: ViewNode[] | undefined; + private _instanceId: number; constructor( view: ViewsWithCommits, @@ -31,10 +34,11 @@ export class AutolinkedItemsNode extends ViewNode { 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 {