mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 03:38:28 +02:00
Use same logic for Recent Activity
This commit is contained in:
parent
e769d2fbc3
commit
3e5a2addd2
2 changed files with 22 additions and 6 deletions
|
@ -664,9 +664,7 @@ Rectangle {
|
|||
|
||||
if (sameItemCount !== tempPurchasesModel.count) {
|
||||
filteredPurchasesModel.clear();
|
||||
for (var i = 0; i < tempPurchasesModel.count; i++) {
|
||||
filteredPurchasesModel.append(tempPurchasesModel.get(i));
|
||||
}
|
||||
filteredPurchasesModel.append(tempPurchasesModel);
|
||||
|
||||
populateDisplayedItemCounts();
|
||||
sortByDate();
|
||||
|
|
|
@ -38,10 +38,25 @@ Item {
|
|||
onHistoryResult : {
|
||||
historyReceived = true;
|
||||
if (result.status === 'success') {
|
||||
transactionHistoryModel.clear();
|
||||
transactionHistoryModel.append(result.data.history);
|
||||
var sameItemCount = 0;
|
||||
tempTransactionHistoryModel.clear();
|
||||
|
||||
tempTransactionHistoryModel.append(result.data.history);
|
||||
|
||||
for (var i = 0; i < tempTransactionHistoryModel.count; i++) {
|
||||
if (!transactionHistoryModel.get(i)) {
|
||||
break;
|
||||
} else if (tempTransactionHistoryModel.get(i).transaction_type === transactionHistoryModel.get(i).transaction_type &&
|
||||
tempTransactionHistoryModel.get(i).text === transactionHistoryModel.get(i).text) {
|
||||
sameItemCount++;
|
||||
}
|
||||
}
|
||||
|
||||
calculatePendingAndInvalidated();
|
||||
if (sameItemCount !== tempTransactionHistoryModel.count) {
|
||||
transactionHistoryModel.clear();
|
||||
transactionHistoryModel.append(tempTransactionHistoryModel);
|
||||
calculatePendingAndInvalidated();
|
||||
}
|
||||
}
|
||||
refreshTimer.start();
|
||||
}
|
||||
|
@ -187,6 +202,9 @@ Item {
|
|||
// Style
|
||||
color: hifi.colors.baseGrayHighlight;
|
||||
}
|
||||
ListModel {
|
||||
id: tempTransactionHistoryModel;
|
||||
}
|
||||
ListModel {
|
||||
id: transactionHistoryModel;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue