Skip to content

Commit d8f3280

Browse files
committed
Fix unneccessary plugin result update
1 parent 8644027 commit d8f3280

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@ public static async Task UpdateManifestAsync(CancellationToken token = default,
2727
{
2828
await manifestUpdateLock.WaitAsync(token).ConfigureAwait(false);
2929

30-
if (UserPlugins == null || UserPlugins.Count == 0 || usePrimaryUrlOnly || DateTime.Now.Subtract(lastFetchedAt) >= fetchTimeout)
30+
if (UserPlugins == null || usePrimaryUrlOnly || DateTime.Now.Subtract(lastFetchedAt) >= fetchTimeout)
3131
{
3232
var results = await mainPluginStore.FetchAsync(token, usePrimaryUrlOnly).ConfigureAwait(false);
3333

34-
UserPlugins = results;
35-
lastFetchedAt = DateTime.Now;
34+
// If the results are empty, we shouldn't update the manifest because the results are invalid.
35+
if (results.Count != 0)
36+
{
37+
UserPlugins = results;
38+
lastFetchedAt = DateTime.Now;
39+
}
3640
}
3741
}
3842
catch (Exception e)

Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public partial class SettingsPanePluginStoreViewModel : BaseModel
1313
{
1414
public string FilterText { get; set; } = string.Empty;
1515

16-
public IList<PluginStoreItemViewModel> ExternalPlugins => PluginsManifest.UserPlugins
17-
.Select(p => new PluginStoreItemViewModel(p))
16+
public IList<PluginStoreItemViewModel> ExternalPlugins =>
17+
PluginsManifest.UserPlugins?.Select(p => new PluginStoreItemViewModel(p))
1818
.OrderByDescending(p => p.Category == PluginStoreItemViewModel.NewRelease)
1919
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.RecentlyUpdated)
2020
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.None)

0 commit comments

Comments
 (0)