cleaner code
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
-1
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user