-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description:
The app uses inconsistent naming for SharedPreferences files, creating maintenance confusion and potential refactoring risks.
Current Inconsistent Names:
- "NumoPrefs" (ModernPOSActivity.kt)
- "app_prefs" (ThemeManager.kt)
- "CashuWalletPrefs" (CashuWalletManager.kt)
- Various other preference files
Issues:
- Maintenance confusion
- Potential data loss during refactoring
- No clear naming convention
Fix Instructions:
- Choose a standard naming pattern (e.g., "numo_" prefix)
- Update all preference file names:
// Standardize to:
private const val PREFS_NAME = "numo_main_prefs"
private const val WALLET_PREFS_NAME = "numo_wallet_prefs"
private const val THEME_PREFS_NAME = "numo_theme_prefs"- Add migration code to preserve existing user settings:
// Migration example:
private fun migratePreferences() {
val oldPrefs = getSharedPreferences("app_prefs", MODE_PRIVATE)
val newPrefs = getSharedPreferences("numo_theme_prefs", MODE_PRIVATE)
if (oldPrefs.all.isNotEmpty() && newPrefs.all.isEmpty()) {
// Migrate old preferences to new file
}
}Priority: Medium - affects maintainability
Metadata
Metadata
Assignees
Labels
No labels