Save storage unconditionally on location set

The storage plugin cannot find USB backups for secondary users if it is not saved before checking if backups exist
This commit is contained in:
Oliver Scott 2022-03-29 14:05:30 +02:00 committed by Chirayu Desai
parent dd57828697
commit d7910a84b4

View file

@ -24,6 +24,7 @@ internal class RestoreStorageViewModel(
override fun onLocationSet(uri: Uri) {
viewModelScope.launch(Dispatchers.IO) {
saveStorage(uri)
val hasBackup = try {
storagePlugin.hasBackup(uri)
} catch (e: IOException) {
@ -31,7 +32,6 @@ internal class RestoreStorageViewModel(
false
}
if (hasBackup) {
saveStorage(uri)
mLocationChecked.postEvent(LocationResult())
} else {
Log.w(TAG, "Location was rejected: $uri")