mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add default token field and check token
This commit is contained in:
parent
e64771f707
commit
6f65e10a10
2 changed files with 7 additions and 6 deletions
|
|
@ -5,7 +5,9 @@ using System.Threading;
|
|||
|
||||
namespace Flow.Launcher.Plugin
|
||||
{
|
||||
public interface IFeatures { }
|
||||
public interface IFeatures
|
||||
{
|
||||
}
|
||||
|
||||
public interface IContextMenu : IFeatures
|
||||
{
|
||||
|
|
@ -33,6 +35,6 @@ namespace Flow.Launcher.Plugin
|
|||
{
|
||||
public List<Result> Results;
|
||||
public Query Query;
|
||||
public CancellationToken Token { get; init; }
|
||||
public CancellationToken Token { get; init; } = default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -135,14 +135,13 @@ namespace Flow.Launcher.ViewModel
|
|||
var plugin = (IResultUpdated)pair.Plugin;
|
||||
plugin.ResultsUpdated += (s, e) =>
|
||||
{
|
||||
if (e.Query.RawQuery == QueryText) // TODO: allow cancellation
|
||||
if (e.Query.RawQuery == QueryText && !e.Token.IsCancellationRequested)
|
||||
{
|
||||
PluginManager.UpdatePluginMetadata(e.Results, pair.Metadata, e.Query);
|
||||
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(e.Results, pair.Metadata, e.Query, _updateToken)))
|
||||
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(e.Results, pair.Metadata, e.Query, e.Token)))
|
||||
{
|
||||
Log.Error("MainViewModel", "Unable to add item to Result Update Queue");
|
||||
}
|
||||
;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue