-
Notifications
You must be signed in to change notification settings - Fork 654
Profile photo not refreshing after upload in Client Profile #2519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from all commits
c91ad3d
1a1ae20
8dfdf65
749f570
c907031
586119e
83c574c
931df6e
503e411
4f00921
507ab52
b4fbffe
ca2f132
3289eb5
8007673
a8073d8
ee52926
24b4601
8e927b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| package com.mifos.core.ui.util | ||
|
|
||
| internal const val PROFILE_SHOULD_REFRESH_KEY = "profile_should_refresh" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Consolidate duplicate constant definition. The same constant
Since both are marked Apply this approach:
🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,11 +17,16 @@ import androidclient.feature.client.generated.resources.choose_from_option | |
| import androidclient.feature.client.generated.resources.delete_dialog_message | ||
| import androidclient.feature.client.generated.resources.delete_dialog_title | ||
| import androidclient.feature.client.generated.resources.delete_photo | ||
| import androidclient.feature.client.generated.resources.dialog_continue | ||
| import androidclient.feature.client.generated.resources.edit_profile_title | ||
| import androidclient.feature.client.generated.resources.feature_client_Image_Upload_Failed | ||
| import androidclient.feature.client.generated.resources.feature_client_Image_Upload_Successful | ||
| import androidclient.feature.client.generated.resources.from_camera | ||
| import androidclient.feature.client.generated.resources.from_gallery | ||
| import androidclient.feature.client.generated.resources.profile_update_error_message | ||
| import androidclient.feature.client.generated.resources.remove | ||
| import androidclient.feature.client.generated.resources.update_profile_photo_message | ||
| import androidclient.feature.client.generated.resources.update_success_message | ||
| import androidclient.feature.client.generated.resources.upload_new_photo | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Spacer | ||
|
|
@@ -48,8 +53,10 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle | |
| import androidx.navigation.NavController | ||
| import com.mifos.core.designsystem.component.BasicDialogState | ||
| import com.mifos.core.designsystem.component.MifosBasicDialog | ||
| import com.mifos.core.designsystem.component.MifosDialogStatus | ||
| import com.mifos.core.designsystem.component.MifosOutlinedButton | ||
| import com.mifos.core.designsystem.component.MifosScaffold | ||
| import com.mifos.core.designsystem.component.MifosStatusDialog | ||
| import com.mifos.core.designsystem.component.MifosTextButton | ||
| import com.mifos.core.designsystem.icon.MifosIcons | ||
| import com.mifos.core.designsystem.theme.DesignToken | ||
|
|
@@ -76,15 +83,6 @@ internal fun ClientProfileEditScreen( | |
| ) { | ||
| val state by viewModel.stateFlow.collectAsStateWithLifecycle() | ||
|
|
||
| EventsEffect(viewModel.eventFlow) { event -> | ||
| when (event) { | ||
| ClientProfileEditEvent.NavigateBack -> onNavigateBack() | ||
| ClientProfileEditEvent.OnSaveSuccess -> { | ||
| onNavigateBack() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| ClientProfileEditScaffold( | ||
| modifier = modifier, | ||
| state = state, | ||
|
|
@@ -198,11 +196,18 @@ private fun ClientProfileEditDialogs( | |
| is ClientProfileEditState.DialogState.Loading -> MifosProgressIndicator() | ||
|
|
||
| is ClientProfileEditState.DialogState.Error -> { | ||
| MifosErrorComponent( | ||
| isNetworkConnected = state.networkConnection, | ||
| message = state.dialogState.message, | ||
| isRetryEnabled = true, | ||
| onRetry = onRetry, | ||
| MifosStatusDialog( | ||
| status = MifosDialogStatus.FAILURE, | ||
| message = stringResource(Res.string.profile_update_error_message), | ||
| onDismissRequest = { onAction(ClientProfileEditAction.DismissModalBottomSheet) } | ||
| ) | ||
| } | ||
|
|
||
| is ClientProfileEditState.DialogState.Success -> { | ||
| MifosStatusDialog( | ||
| status = MifosDialogStatus.SUCCESS, | ||
| message = stringResource(Res.string.update_success_message), | ||
| onDismissRequest = { onAction(ClientProfileEditAction.DismissModalBottomSheet) } | ||
| ) | ||
| } | ||
|
Comment on lines
+199
to
212
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify navigation occurs after successful profile update. The switch to 🏁 Script executed: #!/bin/bash
# Search for the ViewModel implementation to verify success state handling
rg -A 10 "ClientProfileEditAction.DismissModalBottomSheet" --type=kotlin
# Check if DialogState.Success is properly set in the ViewModel
rg -B 5 -A 5 "DialogState.Success" --type=kotlin -g '*ClientProfileEdit*'Length of output: 8200 I need to verify if the navigation logic is still present after dismissing the success dialog. I need to verify if there's a 🏁 Script executed: #!/bin/bash
# Search for LaunchedEffect and navigation logic in the screen
rg -A 20 "LaunchedEffect\|navController\|navigate\(" --type=kotlin -g '*ClientProfileEditScreen*'
# Also check the complete dialog state handling
rg -B 10 "when.*dialogState" --type=kotlin -g '*ClientProfileEditScreen*'Length of output: 1463 🏁 Script executed: #!/bin/bash
# Get the full ClientProfileEditScreen composable function signature and context
rg -B 5 "fun ClientProfileEditScreen" --type=kotlin -A 30 -g '*ClientProfileEditScreen*'
# Search for EventsEffect pattern mentioned in review comment
rg -B 3 -A 10 "EventsEffect\|OnSaveSuccess" --type=kotlin -g '*ClientProfileEdit*'Length of output: 5004 🏁 Script executed: #!/bin/bash
# Search for navController usage in ClientProfileEditScaffold
rg -A 100 "fun ClientProfileEditScaffold" --type=kotlin -g '*ClientProfileEditScreen*' | head -120
# Check if onNavigateBack is called or if there's any side effect after dialog state change
rg "onNavigateBack\|LaunchedEffect.*dialogState" --type=kotlin -g '*ClientProfileEditScreen*'Length of output: 15376 Add navigation trigger after successful profile update. The success dialog now dismisses without navigating. When 🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep dialog test tag string non-translatable.
Line 22 declares
core_designsystem_mifosStatusDialog, which feeds directly into aModifier.testTag. If translators localize this value, every UI test that targets that tag will fail. Please mark it non-translatable (or inline a constant) so the tag stays stable across locales.📝 Committable suggestion
🤖 Prompt for AI Agents