Skip to content

Commit

Permalink
Merge pull request #273 from Elenpay/wallet_filtering
Browse files Browse the repository at this point in the history
Fix channels filter "Opened with".
  • Loading branch information
RodriFS authored Aug 17, 2023
2 parents 695b2b7 + 14cba90 commit 1590fc8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Pages/Channels.razor
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
{
<SelectItem Value="@(wallet.Id)">@wallet.Name</SelectItem>
}
<SelectItem Value="-1">Unknown</SelectItem>
</Select>
</FilterTemplate>
<DisplayTemplate>
Expand Down Expand Up @@ -780,10 +781,16 @@

private bool OnWalletFilter(object? itemValue, object? searchValue)
{
//If the wallet is null it might be a externally created channel, so we return true
if (itemValue == null) return true;
if (searchValue == null || searchValue is 0)
{
return true;
}
if (searchValue is -1)
{
return itemValue == null;
}

return searchValue == null || (int) searchValue == 0 || (int) itemValue == (int) searchValue;
return itemValue is int itemIntValue && searchValue is int searchIntValue && itemIntValue == searchIntValue;
}

private bool OnSourceNodeIdFilter(object? itemValue, object? searchValue)
Expand Down

0 comments on commit 1590fc8

Please sign in to comment.