parent
90653955a6
commit
525609f0af
|
@ -115,13 +115,13 @@
|
|||
(comp :network-name first))
|
||||
address-activities (->> (get activities current-viewing-account-address)
|
||||
(vals)
|
||||
(sort :timestamp))]
|
||||
(sort-by :timestamp))]
|
||||
(->> address-activities
|
||||
(keep #(process-activity-by-type chain-id->network-name %))
|
||||
(group-by (fn [{:keys [timestamp]}]
|
||||
(datetime/timestamp->relative-short-date (* timestamp 1000))))
|
||||
(map (fn [[date activities]]
|
||||
{:title date
|
||||
:data activities
|
||||
:data (reverse activities)
|
||||
:timestamp (:timestamp (first activities))}))
|
||||
(sort-by (fn [{:keys [timestamp]}] (- timestamp)))))))
|
||||
|
|
|
@ -38,48 +38,79 @@
|
|||
:amount-out "0x1"
|
||||
:sender "acc1"
|
||||
:recipient "acc4"
|
||||
:timestamp 1588464000}}
|
||||
"acc3" {4 {:activity-type constants/wallet-activity-type-receive
|
||||
:timestamp 1588464000}
|
||||
4 {:activity-type constants/wallet-activity-type-send
|
||||
:amount-out "0x1"
|
||||
:sender "acc1"
|
||||
:recipient "acc4"
|
||||
:timestamp 1588464100}
|
||||
5 {:activity-type constants/wallet-activity-type-send
|
||||
:amount-out "0x1"
|
||||
:sender "acc1"
|
||||
:recipient "acc4"
|
||||
:timestamp 1588464050}}
|
||||
"acc3" {6 {:activity-type constants/wallet-activity-type-receive
|
||||
:amount-in "0x1"
|
||||
:sender "acc4"
|
||||
:recipient "acc3"
|
||||
:timestamp 1588464000}}})
|
||||
(assoc-in [:wallet :current-viewing-account-address] "acc1"))))
|
||||
(is
|
||||
(match? [{:title "May 3, 2020"
|
||||
:timestamp 1588464000
|
||||
:data [{:relative-date "May 3, 2020"
|
||||
:amount "0"
|
||||
:network-logo nil
|
||||
:recipient "acc4"
|
||||
:transaction :send
|
||||
:token nil
|
||||
:network-name nil
|
||||
:status nil
|
||||
:sender "acc1"
|
||||
:timestamp 1588464000}]}
|
||||
{:title "May 2, 2020"
|
||||
:timestamp 1588377600
|
||||
:data [{:relative-date "May 2, 2020"
|
||||
:amount "0"
|
||||
:network-logo nil
|
||||
:recipient "acc1"
|
||||
:transaction :receive
|
||||
:token nil
|
||||
:network-name nil
|
||||
:status nil
|
||||
:sender "acc2"
|
||||
:timestamp 1588377600}]}
|
||||
{:title "May 1, 2020"
|
||||
:timestamp 1588291200
|
||||
:data [{:relative-date "May 1, 2020"
|
||||
:amount "0"
|
||||
:network-logo nil
|
||||
:recipient "acc2"
|
||||
:transaction :send
|
||||
:token nil
|
||||
:network-name nil
|
||||
:status nil
|
||||
:sender "acc1"
|
||||
:timestamp 1588291200}]}]
|
||||
(rf/sub [sub-name])))))
|
||||
(match?
|
||||
[{:title "May 3, 2020"
|
||||
:timestamp 1588464000
|
||||
:data [{:relative-date "May 3, 2020"
|
||||
:amount "0"
|
||||
:network-logo nil
|
||||
:recipient "acc4"
|
||||
:transaction :send
|
||||
:token nil
|
||||
:network-name nil
|
||||
:status nil
|
||||
:sender "acc1"
|
||||
:timestamp 1588464100}
|
||||
{:relative-date "May 3, 2020"
|
||||
:amount "0"
|
||||
:network-logo nil
|
||||
:recipient "acc4"
|
||||
:transaction :send
|
||||
:token nil
|
||||
:network-name nil
|
||||
:status nil
|
||||
:sender "acc1"
|
||||
:timestamp 1588464050}
|
||||
{:relative-date "May 3, 2020"
|
||||
:amount "0"
|
||||
:network-logo nil
|
||||
:recipient "acc4"
|
||||
:transaction :send
|
||||
:token nil
|
||||
:network-name nil
|
||||
:status nil
|
||||
:sender "acc1"
|
||||
:timestamp 1588464000}]}
|
||||
{:title "May 2, 2020"
|
||||
:timestamp 1588377600
|
||||
:data [{:relative-date "May 2, 2020"
|
||||
:amount "0"
|
||||
:network-logo nil
|
||||
:recipient "acc1"
|
||||
:transaction :receive
|
||||
:token nil
|
||||
:network-name nil
|
||||
:status nil
|
||||
:sender "acc2"
|
||||
:timestamp 1588377600}]}
|
||||
{:title "May 1, 2020"
|
||||
:timestamp 1588291200
|
||||
:data [{:relative-date "May 1, 2020"
|
||||
:amount "0"
|
||||
:network-logo nil
|
||||
:recipient "acc2"
|
||||
:transaction :send
|
||||
:token nil
|
||||
:network-name nil
|
||||
:status nil
|
||||
:sender "acc1"
|
||||
:timestamp 1588291200}]}]
|
||||
(rf/sub [sub-name])))))
|
||||
|
|
Loading…
Reference in New Issue