Skip to content

Commit

Permalink
Fixed bug with two Profile screens on first launch
Browse files Browse the repository at this point in the history
  • Loading branch information
huntj88 committed Jul 4, 2021
1 parent c6565a7 commit 0273abb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ fun HomeScreen(
})

if (!isProfileSetup) {
toUserProfile()
LaunchedEffect("toUserProfile") {
// safely call toUserProfile() once with LaunchedEffect, even though its not a coroutine
toUserProfile()
}
return
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.jameshunt.dhiffiechat.ui.profile

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
Expand All @@ -12,7 +11,6 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
Expand Down

0 comments on commit 0273abb

Please sign in to comment.