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

feat: update tx list with observeTransactions #1331

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

HashEngineering
Copy link
Collaborator

Issue being fixed or feature implemented

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

@HashEngineering HashEngineering self-assigned this Dec 5, 2024
Copy link
Member

@Syn-McJ Syn-McJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, updating rows is working in my testing.

One potential optimization could be made: if we move grouping by date into the ViewModel from the fragment:

val groupedByDate = transactionViews.groupBy {
     Instant.ofEpochMilli(it.time).atZone(ZoneId.systemDefault()).toLocalDate()
}

then we might be able keep a grouped map of transactions, something like this:

private val _transactions = MutableLiveData<Map<LocalDate, List<TransactionRowView>>>()

Then, finding the proper row to change is easier since you only need to get the group based on the transaction date and search within it.

This probably isn't necessary if there is already enough performance benefits achieved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants