File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
app/src/main/java/to/bitkit/viewmodels Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -81,24 +81,21 @@ class WalletViewModel @Inject constructor(
8181 syncState()
8282 refreshBip21ForEvent(event)
8383 }.onFailure { error ->
84- _uiState .update { it.copy(nodeLifecycleState = NodeLifecycleState .ErrorStarting (error)) }
8584 Logger .error(" Node startup error" , error)
8685 throw error
87- }
86+ }.onSuccess {
87+ syncState()
8888
89- _uiState .update { it.copy(nodeLifecycleState = NodeLifecycleState .Running ) }
90- syncState()
89+ lightningRepository.connectToTrustedPeers().onFailure { e ->
90+ Logger .error(" Failed to connect to trusted peers" , e)
91+ }
9192
92- // Connect to trusted peers
93- lightningRepository.connectToTrustedPeers().onFailure { e ->
94- Logger .error(" Failed to connect to trusted peers" , e)
93+ // Refresh BIP21 and sync
94+ launch(bgDispatcher) { refreshBip21() }
95+ launch(bgDispatcher) { sync() }
96+ launch(bgDispatcher) { registerForNotificationsIfNeeded() }
97+ launch(bgDispatcher) { observeDbConfig() }
9598 }
96-
97- // Refresh BIP21 and sync
98- launch(bgDispatcher) { refreshBip21() }
99- launch(bgDispatcher) { sync() }
100- launch(bgDispatcher) { registerForNotificationsIfNeeded() }
101- launch(bgDispatcher) { observeDbConfig() }
10299 }
103100 }
104101
You can’t perform that action at this time.
0 commit comments