Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
deBeauvoir
samourai-wallet-android
Commits
eb6a88d2
Verified
Commit
eb6a88d2
authored
Dec 08, 2021
by
Sarath
⚔
Browse files
Fix: tx duplicates in mix tx adapter
parent
9b9cf2f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
app/src/main/java/com/samourai/wallet/whirlpool/fragments/TransactionsFragment.kt
...mourai/wallet/whirlpool/fragments/TransactionsFragment.kt
+10
-2
No files found.
app/src/main/java/com/samourai/wallet/whirlpool/fragments/TransactionsFragment.kt
View file @
eb6a88d2
...
...
@@ -93,7 +93,11 @@ class TransactionsFragment : Fragment() {
if
(
mix
.
containsKey
(
WhirlpoolAccount
.
PREMIX
)){
preMix
.
clear
()
mix
[
WhirlpoolAccount
.
PREMIX
]
?.
let
{
preMix
.
addAll
(
it
)
// Filter duplicates
val
filteredPremix
=
it
.
filter
{
tx-
>
postMix
.
find
{
tx2-
>
tx2
.
hash
==
tx
.
hash
}
==
null
}
preMix
.
addAll
(
filteredPremix
)
}
}
adapter
.
setTx
(
postMix
,
preMix
)
...
...
@@ -125,10 +129,14 @@ class TransactionsFragment : Fragment() {
val
premixList
=
APIFactory
.
getInstance
(
requireContext
()).
allPremixTx
val
list
=
arrayListOf
<
Tx
>()
list
.
addAll
(
postMixList
)
// Filter duplicates
val
filteredPremix
=
premixList
.
filter
{
tx-
>
postMixList
.
find
{
it
.
hash
==
tx
.
hash
}
==
null
}
list
.
addAll
(
premixList
)
if
(
postMixList
!=
null
)
{
withContext
(
Dispatchers
.
Main
)
{
whirlPoolHomeViewModel
.
setTx
(
postMixList
,
p
remix
List
)
whirlPoolHomeViewModel
.
setTx
(
postMixList
,
filteredP
remix
)
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment