File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
app/src/main/java/to/bitkit/ui/settings Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ import to.bitkit.ui.components.FillHeight
5656import to.bitkit.ui.components.LightningChannel
5757import to.bitkit.ui.components.PrimaryButton
5858import to.bitkit.ui.components.SecondaryButton
59+ import to.bitkit.ui.components.SyncNodeView
5960import to.bitkit.ui.components.TertiaryButton
6061import to.bitkit.ui.components.Title
6162import to.bitkit.ui.components.VerticalSpacer
@@ -139,6 +140,12 @@ private fun Content(
139140 }
140141 }
141142 )
143+
144+ if (! uiState.isNodeRunning) {
145+ SyncNodeView (modifier = Modifier .fillMaxSize())
146+ return @ScreenColumn
147+ }
148+
142149 PullToRefreshBox (
143150 isRefreshing = uiState.isRefreshing,
144151 onRefresh = onRefresh,
@@ -417,3 +424,17 @@ private fun Preview() {
417424 )
418425 }
419426}
427+
428+ @Preview
429+ @Composable
430+ private fun PreviewNodeNotRunning () {
431+ AppThemeSurface {
432+ Content (
433+ uiState = LightningConnectionsUiState (
434+ localBalance = 0u ,
435+ remoteBalance = 0u ,
436+ isNodeRunning = false ,
437+ )
438+ )
439+ }
440+ }
Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ class LightningConnectionsViewModel @Inject constructor(
5050
5151 fun syncState () {
5252 viewModelScope.launch {
53- // TODO handle node not running UI
5453 val isNodeRunning = lightningRepo.lightningState.value.nodeLifecycleState.isRunning()
5554
5655 val channels = lightningRepo.getChannels().orEmpty()
You can’t perform that action at this time.
0 commit comments