Skip to content

Commit 6ebfd7c

Browse files
committed
Improve plugin manifest handling and UI property
Removed remarks from GetPluginManifest docs. GetPluginManifest now returns an empty list if null. ExternalPlugins property always enumerates and sorts plugins. Added BOM to PublicAPIInstance.cs.
1 parent 86d7c1e commit 6ebfd7c

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,6 @@ public interface IPublicAPI
535535
/// <summary>
536536
/// Get the plugin manifest.
537537
/// </summary>
538-
/// <remarks>
539-
/// If Flow cannot get manifest data, this could be null
540-
/// </remarks>
541538
/// <returns></returns>
542539
public IReadOnlyList<UserPlugin> GetPluginManifest();
543540

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Concurrent;
33
using System.Collections.Generic;
44
using System.Collections.Specialized;
@@ -583,7 +583,7 @@ public ValueTask<ImageSource> LoadImageAsync(string path, bool loadFullImage = f
583583
public Task<bool> UpdatePluginManifestAsync(bool usePrimaryUrlOnly = false, CancellationToken token = default) =>
584584
PluginsManifest.UpdateManifestAsync(usePrimaryUrlOnly, token);
585585

586-
public IReadOnlyList<UserPlugin> GetPluginManifest() => PluginsManifest.UserPlugins;
586+
public IReadOnlyList<UserPlugin> GetPluginManifest() => PluginsManifest.UserPlugins ?? [];
587587

588588
public bool PluginModified(string id) => PluginManager.PluginModified(id);
589589

Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public bool ShowExecutable
8282
}
8383
}
8484

85-
public IList<PluginStoreItemViewModel> ExternalPlugins => App.API.GetPluginManifest()?
85+
public IList<PluginStoreItemViewModel> ExternalPlugins => App.API.GetPluginManifest()
8686
.Select(p => new PluginStoreItemViewModel(p))
8787
.OrderByDescending(p => p.Category == PluginStoreItemViewModel.NewRelease)
8888
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.RecentlyUpdated)

0 commit comments

Comments
 (0)