@@ -1148,7 +1148,7 @@ class ViewModel {
1148
1148
this . _onDidChangeMode . fire ( mode ) ;
1149
1149
this . modeContextKey . set ( mode ) ;
1150
1150
1151
- this . storageService . store ( `scm.viewMode` , mode , StorageScope . WORKSPACE , StorageTarget . MACHINE ) ;
1151
+ this . storageService . store ( `scm.viewMode` , mode , StorageScope . WORKSPACE , StorageTarget . USER ) ;
1152
1152
}
1153
1153
1154
1154
get sortKey ( ) : ViewModelSortKey { return this . _sortKey ; }
@@ -1164,7 +1164,7 @@ class ViewModel {
1164
1164
this . sortKeyContextKey . set ( sortKey ) ;
1165
1165
1166
1166
if ( this . _mode === ViewModelMode . List ) {
1167
- this . storageService . store ( `scm.viewSortKey` , sortKey , StorageScope . WORKSPACE , StorageTarget . MACHINE ) ;
1167
+ this . storageService . store ( `scm.viewSortKey` , sortKey , StorageScope . WORKSPACE , StorageTarget . USER ) ;
1168
1168
}
1169
1169
}
1170
1170
@@ -1243,6 +1243,20 @@ class ViewModel {
1243
1243
if ( e . reason === WillSaveStateReason . SHUTDOWN ) {
1244
1244
this . storageService . store ( `scm.viewState` , JSON . stringify ( this . treeViewState ) , StorageScope . WORKSPACE , StorageTarget . MACHINE ) ;
1245
1245
}
1246
+
1247
+ this . mode = this . getViewModelMode ( ) ;
1248
+ this . sortKey = this . getViewModelSortKey ( ) ;
1249
+ } ) ;
1250
+
1251
+ this . storageService . onDidChangeValue ( e => {
1252
+ switch ( e . key ) {
1253
+ case 'scm.viewMode' :
1254
+ this . mode = this . getViewModelMode ( ) ;
1255
+ break ;
1256
+ case 'scm.viewSortKey' :
1257
+ this . sortKey = this . getViewModelSortKey ( ) ;
1258
+ break ;
1259
+ }
1246
1260
} ) ;
1247
1261
}
1248
1262
0 commit comments