From d2f2964ebbe9f0975584c9bf515c8ed7d17414b8 Mon Sep 17 00:00:00 2001 From: Dieguitux Date: Wed, 25 Dec 2024 09:48:14 +0100 Subject: [PATCH] fix: injected params in view models (#189) --- .../unit/multicommunity/detail/MultiCommunityScreen.kt | 2 +- .../unit/multicommunity/editor/MultiCommunityEditorScreen.kt | 2 +- .../raccoonforlemmy/unit/reportlist/ReportListScreen.kt | 2 +- .../raccoonforlemmy/unit/zoomableimage/ZoomableImageScreen.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unit/multicommunity/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/multicommunity/detail/MultiCommunityScreen.kt b/unit/multicommunity/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/multicommunity/detail/MultiCommunityScreen.kt index 282b35e80..302c3bccd 100644 --- a/unit/multicommunity/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/multicommunity/detail/MultiCommunityScreen.kt +++ b/unit/multicommunity/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/multicommunity/detail/MultiCommunityScreen.kt @@ -102,7 +102,7 @@ class MultiCommunityScreen( @OptIn(ExperimentalMaterial3Api::class) @Composable override fun Content() { - val model: MultiCommunityMviModel = rememberScreenModel(communityId) + val model: MultiCommunityMviModel = rememberScreenModel(arg = communityId) val uiState by model.uiState.collectAsState() val topAppBarState = rememberTopAppBarState() val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior(topAppBarState) diff --git a/unit/multicommunity/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/multicommunity/editor/MultiCommunityEditorScreen.kt b/unit/multicommunity/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/multicommunity/editor/MultiCommunityEditorScreen.kt index 449f20fc9..fc5cff810 100644 --- a/unit/multicommunity/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/multicommunity/editor/MultiCommunityEditorScreen.kt +++ b/unit/multicommunity/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/multicommunity/editor/MultiCommunityEditorScreen.kt @@ -69,7 +69,7 @@ class MultiCommunityEditorScreen( @OptIn(ExperimentalMaterial3Api::class) @Composable override fun Content() { - val model: MultiCommunityEditorMviModel = rememberScreenModel(communityId) + val model: MultiCommunityEditorMviModel = rememberScreenModel(arg = communityId ?: 0) val uiState by model.uiState.collectAsState() val navigationCoordinator = remember { getNavigationCoordinator() } diff --git a/unit/reportlist/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/reportlist/ReportListScreen.kt b/unit/reportlist/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/reportlist/ReportListScreen.kt index 27acc5f84..71f7b4421 100644 --- a/unit/reportlist/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/reportlist/ReportListScreen.kt +++ b/unit/reportlist/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/reportlist/ReportListScreen.kt @@ -81,7 +81,7 @@ class ReportListScreen( @OptIn(ExperimentalMaterial3Api::class) @Composable override fun Content() { - val model: ReportListMviModel = rememberScreenModel(communityId ?: 0L) + val model: ReportListMviModel = rememberScreenModel(arg = communityId ?: 0L) val uiState by model.uiState.collectAsState() val topAppBarState = rememberTopAppBarState() val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior(topAppBarState) diff --git a/unit/zoomableimage/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/zoomableimage/ZoomableImageScreen.kt b/unit/zoomableimage/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/zoomableimage/ZoomableImageScreen.kt index dac6ed188..ab8a6ee02 100644 --- a/unit/zoomableimage/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/zoomableimage/ZoomableImageScreen.kt +++ b/unit/zoomableimage/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/unit/zoomableimage/ZoomableImageScreen.kt @@ -62,7 +62,7 @@ class ZoomableImageScreen( @OptIn(ExperimentalMaterial3Api::class) @Composable override fun Content() { - val model: ZoomableImageMviModel = rememberScreenModel(url) + val model: ZoomableImageMviModel = rememberScreenModel(arg = url) val uiState by model.uiState.collectAsState() val snackbarHostState = remember { SnackbarHostState() } val successMessage = LocalStrings.current.messageOperationSuccessful