Skip to content

Commit 0c0d450

Browse files
authored
fix: KiTTY session file selection dialog in Serial form does not appear (#810)
Similar fix as in 9514fcd
1 parent 8ca54ad commit 0c0d450

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Ui/View/Editor/Forms/SerialFormView.xaml.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.IO;
22
using System.Windows;
33
using System.Windows.Controls;
4+
using _1RM.Utils;
45
using _1RM.Utils.KiTTY;
56
using _1RM.Utils.KiTTY.Model;
67
using Shawn.Utils.Wpf.FileSystem;
@@ -16,18 +17,18 @@ public SerialFormView()
1617

1718
private void ButtonSelectSessionConfigFile_OnClick(object sender, RoutedEventArgs e)
1819
{
19-
if (DataContext is IKittyConnectable pc)
20+
if (DataContext is SerialFormViewModel vm)
2021
{
2122
var path = SelectFileHelper.OpenFile(filter: "KiTTY Session|*.*");
2223
if (path == null) return;
23-
if (File.Exists(path)
24-
&& KittyConfig.Read(path)?.Count > 0)
24+
if (File.Exists(path) && KittyConfig.Read(path)?.Count > 0)
2525
{
26-
pc.ExternalKittySessionConfigPath = path;
26+
vm.New.ExternalKittySessionConfigPath = path;
2727
}
2828
else
2929
{
30-
pc.ExternalKittySessionConfigPath = "";
30+
vm.New.ExternalKittySessionConfigPath = "";
31+
MessageBoxHelper.Warning("Invalid KiTTY session config file.");
3132
}
3233
}
3334
}

0 commit comments

Comments
 (0)