add option to sync database after quick-unlocking the database. closes https://github.com/PhilippC/keepass2android/issues/188

This commit is contained in:
Philipp Crocoll
2021-11-17 11:30:43 +01:00
parent 7014f5d9f1
commit 294e6f5edf
11 changed files with 160 additions and 95 deletions

View File

@@ -119,7 +119,7 @@ namespace keepass2android
/// </summary>
IFileStorage GetFileStorage(IOConnectionInfo iocInfo, bool allowCache);
void TriggerReload(Context context);
void TriggerReload(Context context, Action<bool> actionOnResult /*if not null, called when the user selected yes (true) or no (false)*/);
bool CheckForDuplicateUuids { get; }

View File

@@ -51,7 +51,7 @@ namespace keepass2android
if (!MemUtil.ArraysEqual(_app.CurrentDb.KpDatabase.HashOfFileOnDisk, hashingRemoteStream.Hash))
{
_app.TriggerReload(_context);
_app.TriggerReload(_context, null);
Finish(true);
}
else

View File

@@ -85,8 +85,7 @@ namespace keepass2android
{
//only the remote file was modified -> reload database.
//note: it's best to lock the database and do a complete reload here (also better for UI consistency in case something goes wrong etc.)
_app.TriggerReload(_context);
Finish(true);
_app.TriggerReload(_context, (bool result) => Finish(result));
}
}
else