修复个人主页跳转

This commit is contained in:
2024-10-13 04:07:04 +08:00
parent 3c5f8a7787
commit fe3b409b43
4 changed files with 23 additions and 9 deletions

View File

@@ -86,7 +86,7 @@ fun NotificationsScreen() {
) {
NotificationIndicator(
MessageListViewModel.likeNoticeCount,
R.drawable.rider_pro_like,
R.drawable.rider_pro_moment_like,
stringResource(R.string.like_upper)
) {
if (MessageListViewModel.likeNoticeCount > 0) {

View File

@@ -22,6 +22,6 @@ fun ProfileWrap(
MyProfileViewModel.logout(context)
},
profile = MyProfileViewModel.profile,
sharedFlow = MyProfileViewModel.sharedFlow
sharedFlow = MyProfileViewModel.sharedFlow,
)
}

View File

@@ -120,12 +120,19 @@ fun UserItem(accountProfileEntity: AccountProfileEntity) {
)
Spacer(modifier = Modifier.height(4.dp))
// 个人简介
if (accountProfileEntity.bio.isNotEmpty()){
Text(
text = accountProfileEntity.bio,
fontSize = 14.sp,
color = Color.Gray
)
}else{
Text(
text = "No bio here.",
fontSize = 14.sp,
color = Color.Gray
)
}
}
}

View File

@@ -1,10 +1,12 @@
package com.aiosman.riderpro.ui.profile
import android.util.Log
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.lifecycle.viewmodel.compose.viewModel
import com.aiosman.riderpro.LocalNavController
import com.aiosman.riderpro.exp.viewModelFactory
import com.aiosman.riderpro.ui.index.tabs.profile.MyProfileViewModel
import com.aiosman.riderpro.ui.index.tabs.profile.ProfileV3
import com.aiosman.riderpro.ui.navigateToChat
@@ -16,11 +18,16 @@ fun AccountProfileV2(id: String){
val navController = LocalNavController.current
LaunchedEffect(Unit) {
model.loadProfile(id)
MyProfileViewModel.loadProfile()
}
var isSelf = false
if (id == MyProfileViewModel.profile?.id.toString()) {
isSelf = true
}
ProfileV3(
sharedFlow = model.momentsFlow,
profile = model.profile,
isSelf = false,
isSelf = isSelf,
onChatClick = {
model.profile?.let {
navController.navigateToChat(it.id.toString())