Skip to content

Commit

Permalink
workaround for visual glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
soosr committed May 17, 2023
1 parent 4ac274f commit 546df04
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,23 +205,24 @@ public void SelectTransaction(uint256 txid)

if (txnItem is { })
{
txnItem.IsFlashing = true;
// TDG has a visual glitch, if the item is not visible in the list, it will be glitched when gets expanded.
// Selecting first the root item, then the child solves the issue.
var index = _transactions.IndexOf(txnItem);
IndexPath indexPath;
Dispatcher.UIThread.Post(() => Source.RowSelection!.SelectedIndex = new IndexPath(index));

if (txnItem is CoinJoinsHistoryItemViewModel cjGroup &&
cjGroup.CoinJoinTransactions.FirstOrDefault(x => x.TransactionId == txid) is { } child)
cjGroup.Children.FirstOrDefault(x => x.Id == txid) is { } child)
{
txnItem.IsExpanded = true;
var childIndex = cjGroup.CoinJoinTransactions.IndexOf(child);
indexPath = new IndexPath(index, childIndex);
child.IsFlashing = true;

var childIndex = cjGroup.Children.IndexOf(child);
Dispatcher.UIThread.Post(() => Source.RowSelection!.SelectedIndex = new IndexPath(index, childIndex));
}
else
{
indexPath = new IndexPath(index);
txnItem.IsFlashing = true;
}

Dispatcher.UIThread.Post(() => Source.RowSelection!.SelectedIndex = indexPath);
}
}

Expand Down

0 comments on commit 546df04

Please sign in to comment.