diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentsPage.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentsPage.kt index 194d5a41..bd6916d3 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentsPage.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentsPage.kt @@ -36,7 +36,7 @@ fun CommentsPage( contentPadding: PaddingValues, openUserProfile: (String) -> Unit, modifier: Modifier = Modifier, - viewModel: CommentsViewModel = injectedViewModel(), + viewModel: CommentsViewModel = injectedViewModel(key = postId), ) { LaunchedEffect(postId) { viewModel.loadPostDetails(postId) } val commentState by diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt index 9005d237..3c36b954 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/user/UserProfile.kt @@ -44,7 +44,7 @@ fun UserProfile( contentPadding: PaddingValues, openUserProfile: (String) -> Unit, modifier: Modifier = Modifier, - viewModel: UserProfileViewModel = injectedViewModel(), + viewModel: UserProfileViewModel = injectedViewModel(key = username), ) { LaunchedEffect(username) { viewModel.loadProfile(username) } when (val state = viewModel.userProfile) {