File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
mobile/src/main/java/com/windscribe/mobile/ui/serverlist Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,13 @@ class ServerViewModelImpl(
99
99
private val _searchListState = MutableStateFlow <ListState <ServerListItem >>(ListState .Loading )
100
100
override val searchListState: StateFlow <ListState <ServerListItem >> = _searchListState
101
101
102
- private val _selectedServerListType = MutableStateFlow (ServerListType .All )
102
+ private val _selectedServerListType = MutableStateFlow (when (preferencesHelper.lastSelectedTabIndex) {
103
+ 0 -> ServerListType .All
104
+ 1 -> ServerListType .Fav
105
+ 2 -> ServerListType .Static
106
+ 3 -> ServerListType .Config
107
+ else -> ServerListType .All
108
+ })
103
109
override val selectedServerListType: StateFlow <ServerListType > = _selectedServerListType
104
110
105
111
@@ -347,6 +353,12 @@ class ServerViewModelImpl(
347
353
}
348
354
349
355
override fun setSelectedType (type : ServerListType ) {
356
+ preferencesHelper.saveLastSelectedServerTabIndex(when (type) {
357
+ ServerListType .All -> 0
358
+ ServerListType .Fav -> 1
359
+ ServerListType .Static -> 2
360
+ ServerListType .Config -> 3
361
+ })
350
362
_selectedServerListType .value = type
351
363
}
352
364
You can’t perform that action at this time.
0 commit comments