feat(settings): Fix settings to use savings accountId for disabling accounts#2014
feat(settings): Fix settings to use savings accountId for disabling accounts#2014IITI-tushar wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThe ChangesAccount Disabling Logic Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@feature/settings/src/commonMain/kotlin/org/mifospay/feature/settings/SettingsViewModel.kt`:
- Line 231: The hardcoded user-facing message in SettingsViewModel (the
expression it.copy(dialogState = DialogState.Error("Default account not
available"))) should be replaced with the localized string resource used
elsewhere (e.g., Res.string.* or the existing getString(...) helper); update the
DialogState.Error call to pass the resource-backed string (fetching the
appropriate "default_account_not_available" resource) so the ViewModel uses
i18n-consistent messaging.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8359cd1e-883b-4c2c-9834-f679340d7049
📒 Files selected for processing (1)
feature/settings/src/commonMain/kotlin/org/mifospay/feature/settings/SettingsViewModel.kt
| val accountId = userPreferencesRepository.defaultAccountId.value | ||
| if (accountId == null) { | ||
| mutableStateFlow.update { | ||
| it.copy(dialogState = DialogState.Error("Default account not available")) |
There was a problem hiding this comment.
Replace hardcoded error text with a string resource.
"Default account not available" is user-facing and currently hardcoded, while this ViewModel otherwise uses localized Res.string.*/getString(...) messages. Please move this to resources for i18n consistency.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@feature/settings/src/commonMain/kotlin/org/mifospay/feature/settings/SettingsViewModel.kt`
at line 231, The hardcoded user-facing message in SettingsViewModel (the
expression it.copy(dialogState = DialogState.Error("Default account not
available"))) should be replaced with the localized string resource used
elsewhere (e.g., Res.string.* or the existing getString(...) helper); update the
DialogState.Error call to pass the resource-backed string (fetching the
appropriate "default_account_not_available" resource) so the ViewModel uses
i18n-consistent messaging.
…ing account
Issue Fix
Fixes #2013
Jira Task: Task_Number
Screenshots
Description
Apply the
AndroidStyle.xmlstyle template to your code in Android Studio.Run the unit tests with
./gradlew checkto make sure you didn't break anythingIf you have multiple commits please combine them into one commit by squashing them.
Summary by CodeRabbit