Set account to avoid lateinit property account has not been initialized

This commit is contained in:
Vitor Pamplona
2024-01-30 11:20:25 -05:00
parent e59f676d47
commit 1ac990b67c
2 changed files with 3 additions and 1 deletions
@@ -580,7 +580,7 @@ fun BechLink(
) )
} }
} else if (loadedLink?.nip19 != null) { } else if (loadedLink?.nip19 != null) {
Row { ClickableRoute(loadedLink?.nip19!!, accountViewModel, nav) } ClickableRoute(loadedLink?.nip19!!, accountViewModel, nav)
} else { } else {
val text = val text =
remember(word) { remember(word) {
@@ -225,6 +225,7 @@ fun ChatroomListScreenOnlyList(
val observer = val observer =
LifecycleEventObserver { _, event -> LifecycleEventObserver { _, event ->
if (event == Lifecycle.Event.ON_RESUME) { if (event == Lifecycle.Event.ON_RESUME) {
NostrChatroomListDataSource.account = accountViewModel.account
NostrChatroomListDataSource.start() NostrChatroomListDataSource.start()
} }
} }
@@ -303,6 +304,7 @@ fun WatchAccountForListScreen(
) { ) {
LaunchedEffect(accountViewModel) { LaunchedEffect(accountViewModel) {
launch(Dispatchers.IO) { launch(Dispatchers.IO) {
NostrChatroomListDataSource.account = accountViewModel.account
NostrChatroomListDataSource.start() NostrChatroomListDataSource.start()
knownFeedViewModel.invalidateData(true) knownFeedViewModel.invalidateData(true)
newFeedViewModel.invalidateData(true) newFeedViewModel.invalidateData(true)