mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-09 15:58:57 +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,
|
otherInstance = otherInstance,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
model.bindToLifecycle(key)
|
model.bindToLifecycle(key + community.id.toString())
|
||||||
val uiState by model.uiState.collectAsState()
|
val uiState by model.uiState.collectAsState()
|
||||||
val lazyListState = rememberLazyListState()
|
val lazyListState = rememberLazyListState()
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
|
@ -124,7 +124,7 @@ class PostDetailScreen(
|
|||||||
otherInstance = otherInstance,
|
otherInstance = otherInstance,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
model.bindToLifecycle(key)
|
model.bindToLifecycle(key + post.id.toString())
|
||||||
val uiState by model.uiState.collectAsState()
|
val uiState by model.uiState.collectAsState()
|
||||||
val isOnOtherInstance = otherInstance.isNotEmpty()
|
val isOnOtherInstance = otherInstance.isNotEmpty()
|
||||||
val navigationCoordinator = remember { getNavigationCoordinator() }
|
val navigationCoordinator = remember { getNavigationCoordinator() }
|
||||||
|
@ -110,7 +110,7 @@ class UserDetailScreen(
|
|||||||
val model = rememberScreenModel(user.id.toString()) {
|
val model = rememberScreenModel(user.id.toString()) {
|
||||||
getUserDetailViewModel(user, otherInstance)
|
getUserDetailViewModel(user, otherInstance)
|
||||||
}
|
}
|
||||||
model.bindToLifecycle(key)
|
model.bindToLifecycle(key + user.id.toString())
|
||||||
val uiState by model.uiState.collectAsState()
|
val uiState by model.uiState.collectAsState()
|
||||||
val lazyListState = rememberLazyListState()
|
val lazyListState = rememberLazyListState()
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user