Skip to content

Commit 470f7f2

Browse files
Copilotalexr00
andcommitted
Refactor: Extract _appendLocalSuffix helper method
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 4e39b54 commit 470f7f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/view/treeNodes/fileChangeNode.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,17 @@ export class GitFileChangeNode extends FileChangeNode implements vscode.TreeItem
299299
private _comments?: IComment[]
300300
) {
301301
super(parent, pullRequestManager, pullRequest, changeModel);
302+
this._appendLocalSuffix();
303+
}
304+
305+
private _appendLocalSuffix() {
302306
// Mark as local file to distinguish from remote files
303307
this.contextValue = `${this.contextValue}:local`;
304308
}
305309

306310
override updateViewed(viewed: ViewedState) {
307311
super.updateViewed(viewed);
308-
// Re-append the :local suffix after parent updates contextValue
309-
this.contextValue = `${this.contextValue}:local`;
312+
this._appendLocalSuffix();
310313
}
311314

312315
get comments(): IComment[] {

0 commit comments

Comments
 (0)