From bd074c39b4b02c01d6d28af48f699cf693c0359e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Mon, 28 Sep 2020 11:57:24 +0200 Subject: [PATCH] :lipstick: --- .../contrib/scm/common/scmService.ts | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/vs/workbench/contrib/scm/common/scmService.ts b/src/vs/workbench/contrib/scm/common/scmService.ts index 1cb479864bd..50282ded800 100644 --- a/src/vs/workbench/contrib/scm/common/scmService.ts +++ b/src/vs/workbench/contrib/scm/common/scmService.ts @@ -15,13 +15,6 @@ class SCMInput implements ISCMInput { private _value = ''; get value(): string { - if (this.root) { - const key = `scm/input:${this.repository.provider.label}:${this.root.path}`; - let storedValue = this.storageService.get(key, StorageScope.WORKSPACE); - if (storedValue) { - return storedValue; - } - } return this._value; } @@ -29,14 +22,17 @@ class SCMInput implements ISCMInput { if (value === this._value) { return; } + this._value = value; - if (this.root) { - const key = `scm/input:${this.repository.provider.label}:${this.root.path}`; + + if (this.repository.provider.rootUri) { + const key = `scm/input:${this.repository.provider.label}:${this.repository.provider.rootUri.path}`; this.storageService.store(key, value, StorageScope.WORKSPACE); } + this._onDidChange.fire(value); } - private root; + private readonly _onDidChange = new Emitter(); readonly onDidChange: Event = this._onDidChange.event; @@ -87,8 +83,10 @@ class SCMInput implements ISCMInput { readonly repository: ISCMRepository, @IStorageService private storageService: IStorageService ) { - this.root = this.repository.provider.rootUri; - this._value = this.value; + if (this.repository.provider.rootUri) { + const key = `scm/input:${this.repository.provider.label}:${this.repository.provider.rootUri.path}`; + this._value = this.storageService.get(key, StorageScope.WORKSPACE, ''); + } } } -- GitLab