Skip to content

Commit

Permalink
Fix messed up merge
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Grabmeier <flo.grabmeier@gmail.com>
  • Loading branch information
flooxo committed Jan 9, 2024
1 parent 02d8140 commit c494af2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions Flow.Launcher.Plugin.WireGuard/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,27 @@ public class WireGuardPlugin : IPlugin, IPluginI18n, ISettingProvider
public List<Result> Query(Query query)
{
var interfaces = interfaceService.GetAll()
.Where(interface_ => interface_.name.Contains(query.Search, StringComparison.OrdinalIgnoreCase));
var connectedInterface = interfaces.FirstOrDefault(interface_ => interface_.isConnected);
.Where(interface_ => interface_.Name.Contains(query.Search, StringComparison.OrdinalIgnoreCase));
var connectedInterface = interfaces.FirstOrDefault(interface_ => interface_.IsConnected);
var hasConnection = connectedInterface != null;

var results = interfaces
.Where(interface_ => interface_ != connectedInterface)
.Select(interface_ => new Result
{
Title = interface_.name,
SubTitle = interface_.getSubTitle(Context),
Title = interface_.Name,
SubTitle = interface_.GetSubTitle(Context, hasConnection, connectedInterface),
IcoPath = Image,
Score = 0,
Action = _ =>
{
if (interface_.isConnected)
if (interface_.IsConnected)
{
interface_.deactivate();
interface_.Deactivate();
}
else
{
interface_.activate();
interface_.Activate(hasConnection, connectedInterface);
}
return true;
Expand All @@ -59,13 +60,13 @@ public List<Result> Query(Query query)
{
var topResult = new Result
{
Title = connectedInterface.name,
SubTitle = connectedInterface.getSubTitle(Context),
Title = connectedInterface.Name,
SubTitle = connectedInterface.GetSubTitle(Context, hasConnection, connectedInterface),
IcoPath = Image,
Score = 1,
Action = _ =>
{
connectedInterface.deactivate();
connectedInterface.Deactivate();
return true;
}
};
Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher.Plugin.WireGuard/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name": "WireGuard",
"Description": "Connect to VPN via WireGuard interfaces",
"Author": "flooxo",
"Version": "1.0.1",
"Version": "1.0.2",
"Language": "csharp",
"Website": "https://github.com/flooxo/Flow.Plugin.WireGuard",
"ExecuteFileName": "Flow.Launcher.Plugin.WireGuard.dll",
Expand Down

0 comments on commit c494af2

Please sign in to comment.