cleaner code

This commit is contained in:
davotoula
2026-01-04 12:27:07 +01:00
parent 0d923b5caa
commit a4925de4a1
2 changed files with 2 additions and 5 deletions
@@ -248,14 +248,12 @@ object LocalPreferences {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
val prefsDir = File(prefsDirPath) val prefsDir = File(prefsDirPath)
prefsDir.list()?.forEach { prefsDir.list()?.forEach {
if (it.contains(npub)) { if (it.contains(npub) && !File(prefsDir, it).delete()) {
if (!File(prefsDir, it).delete()) {
Log.w("LocalPreferences", "Failed to delete preference file: $it") Log.w("LocalPreferences", "Failed to delete preference file: $it")
} }
} }
} }
} }
}
private fun encryptedPreferences(npub: String? = null): SharedPreferences { private fun encryptedPreferences(npub: String? = null): SharedPreferences {
checkNotInMainThread() checkNotInMainThread()
@@ -972,7 +972,6 @@ open class ShortNotePostViewModel :
val uploadErrorTitle = stringRes(appContext, R.string.upload_error_title) val uploadErrorTitle = stringRes(appContext, R.string.upload_error_title)
val uploadVoiceNip95NotSupported = stringRes(appContext, R.string.upload_error_voice_message_nip95_not_supported) val uploadVoiceNip95NotSupported = stringRes(appContext, R.string.upload_error_voice_message_nip95_not_supported)
val uploadVoiceFailed = stringRes(appContext, R.string.upload_error_voice_message_failed) val uploadVoiceFailed = stringRes(appContext, R.string.upload_error_voice_message_failed)
val uploadVoiceUnexpected = stringRes(appContext, R.string.upload_error_voice_message_unexpected_state)
val uploadVoiceExceptionMessage: (String) -> String = { detail -> val uploadVoiceExceptionMessage: (String) -> String = { detail ->
stringRes(appContext, R.string.upload_error_voice_message_exception, detail) stringRes(appContext, R.string.upload_error_voice_message_exception, detail)
} }