fix app not closing: delete extra window

This commit is contained in:
2025-12-01 14:39:20 +03:00
parent 2970bcc15b
commit 8c6a388507

View File

@@ -38,7 +38,6 @@ namespace KeyKeeper.Views
{
if (file.TryGetLocalPath() is string path)
{
ShowMessage($"Создание нового хранилища: {path}");
(DataContext as MainWindowViewModel)!.CreateVault(path);
OpenRepositoryWindow();
}
@@ -70,25 +69,12 @@ namespace KeyKeeper.Views
var file = files[0];
if (file.TryGetLocalPath() is string path)
{
ShowMessage($"Открытие хранилища: {path}");
(DataContext as MainWindowViewModel)!.OpenVault(path);
OpenRepositoryWindow();
}
}
}
private void ShowMessage(string message)
{
// Временное решение для показа сообщений
var messageBox = new Window
{
Title = "KeyKeeper",
Content = new TextBlock { Text = message, Margin = new Thickness(20) },
SizeToContent = SizeToContent.WidthAndHeight,
WindowStartupLocation = WindowStartupLocation.CenterOwner
};
messageBox.ShowDialog(this);
}
private void OpenRepositoryWindow()
{
var repositoryWindow = new RepositoryWindow()