File tree Expand file tree Collapse file tree
app/src/main/java/to/bitkit/ui/settings/advanced Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,26 +73,24 @@ class RgsServerViewModel @Inject constructor(
7373 _uiState .update { it.copy(isLoading = true ) }
7474
7575 viewModelScope.launch(bgDispatcher) {
76- runCatching {
77- lightningRepo.restartWithRgsServer(url)
78- .onSuccess {
79- _uiState .update {
80- val newState = it.copy(
81- isLoading = false ,
82- connectionResult = Result .success(Unit ),
83- )
84- computeState(newState)
85- }
76+ lightningRepo.restartWithRgsServer(url)
77+ .onSuccess {
78+ _uiState .update {
79+ val newState = it.copy(
80+ isLoading = false ,
81+ connectionResult = Result .success(Unit ),
82+ )
83+ computeState(newState)
84+ }
85+ }
86+ .onFailure { e ->
87+ _uiState .update {
88+ it.copy(
89+ isLoading = false ,
90+ connectionResult = Result .failure(e),
91+ )
8692 }
87- .onFailure { error -> throw error }
88- }.onFailure { e ->
89- _uiState .update {
90- it.copy(
91- isLoading = false ,
92- connectionResult = Result .failure(e),
93- )
9493 }
95- }
9694 }
9795 }
9896
You can’t perform that action at this time.
0 commit comments