mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-09-03 05:10:27 +03:00
Merge pull request #241 from jellyfin/fix-apiclient-crash
Only change server location when different
This commit is contained in:
@@ -22,7 +22,9 @@ class MainViewModel(
|
||||
init {
|
||||
viewModelScope.launch {
|
||||
serverState.collect { state ->
|
||||
apiClient.ChangeServerLocation(state.server?.hostname?.trimEnd('/'))
|
||||
val serverAddress = state.server?.hostname?.trimEnd('/')
|
||||
if (apiClient.serverAddress != serverAddress)
|
||||
apiClient.ChangeServerLocation(serverAddress)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user