mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
delete databases more carefully
This commit is contained in:
@@ -170,7 +170,16 @@ public class AccountManager {
|
||||
|
||||
sharedPreferences.edit().putString("prev_account_db_name", "").apply();
|
||||
sharedPreferences.edit().putString("curr_account_db_name", prevDbName).apply();
|
||||
deleteAccount(context, inCreationDbName);
|
||||
|
||||
// delete the previous account, however, as a resilience check, make sure,
|
||||
// we do not delete already configured accounts (just in case sth. changes the flow of activities)
|
||||
DcContext testContext = new DcContext(null);
|
||||
if (testContext.open(new File(context.getFilesDir(), inCreationDbName).getAbsolutePath()) != 0) {
|
||||
if (testContext.isConfigured() == 0) {
|
||||
testContext.close();
|
||||
deleteAccount(context, inCreationDbName);
|
||||
}
|
||||
}
|
||||
|
||||
resetDcContext(context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user