mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Resuming correctly re-opens the previsouly opened database
This commit is contained in:
@@ -18,10 +18,6 @@ namespace ModernKeePass.Application.Database.Commands.CloseDatabase
|
||||
{
|
||||
if (!_database.IsOpen) throw new DatabaseClosedException();
|
||||
_database.CloseDatabase();
|
||||
|
||||
// Cleanup
|
||||
_database.FileAccessToken = null;
|
||||
_database.Size = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,8 @@ namespace ModernKeePass.Application.Database.Queries.ReOpenDatabase
|
||||
|
||||
public async Task Handle(ReOpenDatabaseQuery message)
|
||||
{
|
||||
if (!_database.IsOpen) throw new DatabaseClosedException();
|
||||
if (_database.IsOpen) throw new DatabaseOpenException();
|
||||
if (string.IsNullOrEmpty(_database.FileAccessToken)) throw new DatabaseClosedException();
|
||||
|
||||
var file = await _file.OpenBinaryFile(_database.FileAccessToken);
|
||||
await _database.ReOpen(file);
|
||||
|
Reference in New Issue
Block a user