Skip to content

Commit

Permalink
fix tx indexes on native activity list (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobar79 committed Jun 16, 2020
1 parent 625a9df commit 50e123b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ios/RCTConvert+TransactionList.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
{
json = [self NSArray:json];
NSMutableArray *result = [[NSMutableArray alloc] init];
int index = 0;

for (id t in json) {
NSDictionary *data = [self NSDictionary:t];
Expand Down Expand Up @@ -80,6 +81,9 @@
transaction.minedAt = [[NSDate alloc] init];
}

transaction.originalIndex = [[NSNumber alloc] initWithInt:index];
index+=1;

[result addObject:transaction];
}
return result;
Expand Down
1 change: 1 addition & 0 deletions ios/Transaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import Foundation

@objcMembers class Transaction: NSObject {
var originalIndex: NSNumber!;
var transactionDescription: String!
var title: String!
var type: String!
Expand Down
2 changes: 1 addition & 1 deletion ios/TransactionListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class TransactionListView: UIView, UITableViewDelegate, UITableViewDataSource {

cell.onItemPress = onTransactionPress
cell.layer.anchorPoint = transformOrigin
cell.row = indexPath.row
cell.row = transaction.originalIndex.intValue
cell.scaleTo = scaleTo
cell.set(transaction: transaction)
cell.selectionStyle = .none
Expand Down

0 comments on commit 50e123b

Please sign in to comment.