From 6d64abd21a3b536d889c61d85d2c5384388834ed Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Thu, 15 Jun 2023 21:30:30 +0800 Subject: [PATCH] Load bookmarks in Query() if not initialized --- Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs index f31d20625..7d214f5c6 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs @@ -24,6 +24,8 @@ namespace Flow.Launcher.Plugin.BrowserBookmark private static Settings _settings; + private static bool initialized = false; + public void Init(PluginInitContext context) { Main.context = context; @@ -31,6 +33,8 @@ namespace Flow.Launcher.Plugin.BrowserBookmark _settings = context.API.LoadSettingJsonStorage(); LoadBookmarksIfEnabled(); + + initialized = true; } private static void LoadBookmarksIfEnabled() @@ -48,6 +52,12 @@ namespace Flow.Launcher.Plugin.BrowserBookmark public List Query(Query query) { + if (!initialized) + { + LoadBookmarksIfEnabled(); + initialized = true; + } + string param = query.Search.TrimStart(); // Should top results be returned? (true if no search parameters have been passed)