Skip to content

Commit 6d64abd

Browse files
Load bookmarks in Query() if not initialized
1 parent 4591fa7 commit 6d64abd

File tree

1 file changed

+10
-0
lines changed
  • Plugins/Flow.Launcher.Plugin.BrowserBookmark

1 file changed

+10
-0
lines changed

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex
2424

2525
private static Settings _settings;
2626

27+
private static bool initialized = false;
28+
2729
public void Init(PluginInitContext context)
2830
{
2931
Main.context = context;
3032

3133
_settings = context.API.LoadSettingJsonStorage<Settings>();
3234

3335
LoadBookmarksIfEnabled();
36+
37+
initialized = true;
3438
}
3539

3640
private static void LoadBookmarksIfEnabled()
@@ -48,6 +52,12 @@ private static void LoadBookmarksIfEnabled()
4852

4953
public List<Result> Query(Query query)
5054
{
55+
if (!initialized)
56+
{
57+
LoadBookmarksIfEnabled();
58+
initialized = true;
59+
}
60+
5161
string param = query.Search.TrimStart();
5262

5363
// Should top results be returned? (true if no search parameters have been passed)

0 commit comments

Comments
 (0)