@@ -13,7 +13,6 @@ import { IStorageLegacyService, StorageLegacyScope } from 'vs/platform/storage/c
1313import { addDisposableListener } from 'vs/base/browser/dom' ;
1414import { startsWith } from 'vs/base/common/strings' ;
1515import { ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle' ;
16- import { isUndefinedOrNull } from 'vs/base/common/types' ;
1716
1817export class StorageService extends Disposable implements IStorageService {
1918 _serviceBrand : any ;
@@ -133,34 +132,34 @@ export class DelegatingStorageService extends Disposable implements IStorageServ
133132 }
134133
135134 get ( key : string , scope : StorageScope , fallbackValue ?: any ) : string {
136- const dbValue = this . storageService . get ( key , scope ) ;
137135 const localStorageValue = this . storageLegacyService . get ( key , this . convertScope ( scope ) , fallbackValue ) ;
136+ const dbValue = this . storageService . get ( key , scope , localStorageValue ) ;
138137
139138 this . assertStorageValue ( key , scope , dbValue , localStorageValue ) ;
140139
141- return localStorageValue ;
140+ return dbValue ;
142141 }
143142
144143 getBoolean ( key : string , scope : StorageScope , fallbackValue ?: boolean ) : boolean {
145- const dbValue = this . storageService . getBoolean ( key , scope ) ;
146144 const localStorageValue = this . storageLegacyService . getBoolean ( key , this . convertScope ( scope ) , fallbackValue ) ;
145+ const dbValue = this . storageService . getBoolean ( key , scope , localStorageValue ) ;
147146
148147 this . assertStorageValue ( key , scope , dbValue , localStorageValue ) ;
149148
150- return localStorageValue ;
149+ return dbValue ;
151150 }
152151
153152 getInteger ( key : string , scope : StorageScope , fallbackValue ?: number ) : number {
154- const dbValue = this . storageService . getInteger ( key , scope ) ;
155153 const localStorageValue = this . storageLegacyService . getInteger ( key , this . convertScope ( scope ) , fallbackValue ) ;
154+ const dbValue = this . storageService . getInteger ( key , scope , localStorageValue ) ;
156155
157156 this . assertStorageValue ( key , scope , dbValue , localStorageValue ) ;
158157
159- return localStorageValue ;
158+ return dbValue ;
160159 }
161160
162161 private assertStorageValue ( key : string , scope : StorageScope , dbValue : any , storageValue : any ) : void {
163- if ( ! isUndefinedOrNull ( dbValue ) && dbValue !== storageValue ) {
162+ if ( dbValue !== storageValue ) {
164163 this . logService . error ( `Unexpected storage value (key: ${ key } , scope: ${ scope === StorageScope . GLOBAL ? 'global' : 'workspace' } ), actual: ${ dbValue } , expected: ${ storageValue } ` ) ;
165164 }
166165 }
0 commit comments