Using the correct observer for picture profile in the Top bar.
This commit is contained in:
@@ -451,8 +451,6 @@ fun GenericMainTopBar(
|
|||||||
nav: (String) -> Unit,
|
nav: (String) -> Unit,
|
||||||
content: @Composable (AccountViewModel) -> Unit
|
content: @Composable (AccountViewModel) -> Unit
|
||||||
) {
|
) {
|
||||||
val coroutineScope = rememberCoroutineScope()
|
|
||||||
|
|
||||||
Column(modifier = BottomTopHeight) {
|
Column(modifier = BottomTopHeight) {
|
||||||
MyTopAppBar(
|
MyTopAppBar(
|
||||||
elevation = 0.dp,
|
elevation = 0.dp,
|
||||||
@@ -476,6 +474,7 @@ fun GenericMainTopBar(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
|
val coroutineScope = rememberCoroutineScope()
|
||||||
LoggedInUserPictureDrawer(accountViewModel) {
|
LoggedInUserPictureDrawer(accountViewModel) {
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
scaffoldState.drawerState.open()
|
scaffoldState.drawerState.open()
|
||||||
@@ -506,10 +505,9 @@ private fun LoggedInUserPictureDrawer(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
onClick: () -> Unit
|
onClick: () -> Unit
|
||||||
) {
|
) {
|
||||||
val accountUserState by accountViewModel.account.userProfile().live().metadata.observeAsState()
|
val profilePicture by accountViewModel.account.userProfile().live().profilePictureChanges.observeAsState()
|
||||||
|
|
||||||
val pubkeyHex = remember { accountUserState?.user?.pubkeyHex ?: "" }
|
val pubkeyHex = remember { accountViewModel.userProfile().pubkeyHex }
|
||||||
val profilePicture = remember(accountUserState) { accountUserState?.user?.profilePicture() }
|
|
||||||
|
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = onClick
|
onClick = onClick
|
||||||
|
|||||||
Reference in New Issue
Block a user