mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Added the option to close DB without saving
Changed the way recent files are retrieved Stopped showing the DB Closed exception on suspend Reordering entries works Moved code from infra to application Cleanup
This commit is contained in:
@@ -11,7 +11,7 @@ namespace ModernKeePass.ViewModels
|
||||
public class SaveVm
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
public SaveVm() : this(App.Services.GetService<IMediator>()) { }
|
||||
public SaveVm() : this(App.Services.GetRequiredService<IMediator>()) { }
|
||||
|
||||
public SaveVm(IMediator mediator)
|
||||
{
|
||||
@@ -21,7 +21,7 @@ namespace ModernKeePass.ViewModels
|
||||
public async Task Save(bool close = true)
|
||||
{
|
||||
await _mediator.Send(new SaveDatabaseCommand());
|
||||
if (close) await _mediator.Send(new CloseDatabaseCommand());
|
||||
if (close) await Close();
|
||||
}
|
||||
|
||||
public async Task Save(StorageFile file)
|
||||
@@ -29,5 +29,10 @@ namespace ModernKeePass.ViewModels
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file);
|
||||
await _mediator.Send(new SaveDatabaseCommand { FilePath = token });
|
||||
}
|
||||
|
||||
public async Task Close()
|
||||
{
|
||||
await _mediator.Send(new CloseDatabaseCommand());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user