From b7e51e5e69c5c5450b7645f544281e3be2d86187 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 8 Oct 2022 18:32:42 +0900 Subject: [PATCH] Fix Install Button --- Flow.Launcher/SettingWindow.xaml.cs | 2 +- Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index e681d78ab..db46b6f24 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -306,7 +306,7 @@ namespace Flow.Launcher private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e) { - if (sender is Button { DataContext: UserPlugin plugin }) + if (sender is Button { DataContext: PluginStoreItemViewModel plugin }) { var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7"); var actionKeyword = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0]; diff --git a/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs b/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs index 606511738..e0235b5ac 100644 --- a/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs @@ -14,16 +14,17 @@ namespace Flow.Launcher.ViewModel private UserPlugin _plugin; + public string ID => _plugin.ID; public string Name => _plugin.Name; public string Description => _plugin.Description; - public string IcoPath => _plugin.IcoPath; public string Author => _plugin.Author; - public string Website => _plugin.Website; + public string Version => _plugin.Version; public string Language => _plugin.Language; + public string Website => _plugin.Website; public string UrlDownload => _plugin.UrlDownload; public string UrlSourceCode => _plugin.UrlSourceCode; - public string Version => _plugin.Version; - + public string IcoPath => _plugin.IcoPath; + public bool LabelNew => _plugin.LatestReleaseDate-DateTime.Now < TimeSpan.FromDays(7); public bool LabelInstalled => PluginManager.GetPluginForId(_plugin.ID) != null; public bool LabelUpdated => _plugin.DateAdded -DateTime.Now < TimeSpan.FromDays(5) && !LabelNew;