mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-03 21:57:33 +01:00
fix: lifecycle view model in detail screens (#70)
This commit is contained in:
parent
ac71df56c7
commit
6178cddef4
@ -112,7 +112,7 @@ class CommunityDetailScreen(
|
||||
otherInstance = otherInstance,
|
||||
)
|
||||
}
|
||||
model.bindToLifecycle(key)
|
||||
model.bindToLifecycle(key + community.id.toString())
|
||||
val uiState by model.uiState.collectAsState()
|
||||
val lazyListState = rememberLazyListState()
|
||||
val scope = rememberCoroutineScope()
|
||||
|
@ -124,7 +124,7 @@ class PostDetailScreen(
|
||||
otherInstance = otherInstance,
|
||||
)
|
||||
}
|
||||
model.bindToLifecycle(key)
|
||||
model.bindToLifecycle(key + post.id.toString())
|
||||
val uiState by model.uiState.collectAsState()
|
||||
val isOnOtherInstance = otherInstance.isNotEmpty()
|
||||
val navigationCoordinator = remember { getNavigationCoordinator() }
|
||||
|
@ -110,7 +110,7 @@ class UserDetailScreen(
|
||||
val model = rememberScreenModel(user.id.toString()) {
|
||||
getUserDetailViewModel(user, otherInstance)
|
||||
}
|
||||
model.bindToLifecycle(key)
|
||||
model.bindToLifecycle(key + user.id.toString())
|
||||
val uiState by model.uiState.collectAsState()
|
||||
val lazyListState = rememberLazyListState()
|
||||
val scope = rememberCoroutineScope()
|
||||
|
Loading…
x
Reference in New Issue
Block a user