Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tx indexes on native activity list #793

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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