mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-04-17 18:16:28 +03:00
add the hasUnsavedChanges flag to the methods
This commit is contained in:
@@ -33,6 +33,7 @@ public class UnlockedRepositoryViewModel : ViewModelBase
|
||||
public UnlockedRepositoryViewModel(IPassStore store)
|
||||
{
|
||||
passStore = store;
|
||||
HasUnsavedChanges = false;
|
||||
}
|
||||
|
||||
public void AddEntry(PassStoreEntry entry)
|
||||
@@ -40,6 +41,7 @@ public class UnlockedRepositoryViewModel : ViewModelBase
|
||||
if (entry is PassStoreEntryPassword)
|
||||
{
|
||||
(passStore.GetRootDirectory() as PassStoreEntryGroup)!.ChildEntries.Add(entry);
|
||||
HasUnsavedChanges = true;
|
||||
OnPropertyChanged(nameof(Passwords));
|
||||
}
|
||||
}
|
||||
@@ -47,11 +49,13 @@ public class UnlockedRepositoryViewModel : ViewModelBase
|
||||
public void DeleteEntry(Guid id)
|
||||
{
|
||||
(passStore.GetRootDirectory() as PassStoreEntryGroup)!.DeleteEntry(id);
|
||||
HasUnsavedChanges = true;
|
||||
OnPropertyChanged(nameof(Passwords));
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
passStore.Save();
|
||||
HasUnsavedChanges = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user