Merge pull request #241 from jellyfin/fix-apiclient-crash

Only change server location when different
This commit is contained in:
Niels van Velzen
2020-11-19 19:10:44 +01:00
committed by GitHub
@@ -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)
}
}