mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix unneccessary plugin result update
This commit is contained in:
parent
864402704d
commit
d8f3280632
2 changed files with 9 additions and 5 deletions
|
|
@ -27,12 +27,16 @@ namespace Flow.Launcher.Core.ExternalPlugins
|
||||||
{
|
{
|
||||||
await manifestUpdateLock.WaitAsync(token).ConfigureAwait(false);
|
await manifestUpdateLock.WaitAsync(token).ConfigureAwait(false);
|
||||||
|
|
||||||
if (UserPlugins == null || UserPlugins.Count == 0 || usePrimaryUrlOnly || DateTime.Now.Subtract(lastFetchedAt) >= fetchTimeout)
|
if (UserPlugins == null || usePrimaryUrlOnly || DateTime.Now.Subtract(lastFetchedAt) >= fetchTimeout)
|
||||||
{
|
{
|
||||||
var results = await mainPluginStore.FetchAsync(token, usePrimaryUrlOnly).ConfigureAwait(false);
|
var results = await mainPluginStore.FetchAsync(token, usePrimaryUrlOnly).ConfigureAwait(false);
|
||||||
|
|
||||||
UserPlugins = results;
|
// If the results are empty, we shouldn't update the manifest because the results are invalid.
|
||||||
lastFetchedAt = DateTime.Now;
|
if (results.Count != 0)
|
||||||
|
{
|
||||||
|
UserPlugins = results;
|
||||||
|
lastFetchedAt = DateTime.Now;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ public partial class SettingsPanePluginStoreViewModel : BaseModel
|
||||||
{
|
{
|
||||||
public string FilterText { get; set; } = string.Empty;
|
public string FilterText { get; set; } = string.Empty;
|
||||||
|
|
||||||
public IList<PluginStoreItemViewModel> ExternalPlugins => PluginsManifest.UserPlugins
|
public IList<PluginStoreItemViewModel> ExternalPlugins =>
|
||||||
.Select(p => new PluginStoreItemViewModel(p))
|
PluginsManifest.UserPlugins?.Select(p => new PluginStoreItemViewModel(p))
|
||||||
.OrderByDescending(p => p.Category == PluginStoreItemViewModel.NewRelease)
|
.OrderByDescending(p => p.Category == PluginStoreItemViewModel.NewRelease)
|
||||||
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.RecentlyUpdated)
|
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.RecentlyUpdated)
|
||||||
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.None)
|
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.None)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue