|
53 | 53 | (when (contains? view-ids-to-track view-id)
|
54 | 54 | (navigation-event (name view-id))))
|
55 | 55 |
|
| 56 | +(defn collectilbes-fetched-event |
| 57 | + [db] |
| 58 | + (let [accounts (get-in db [:wallet :accounts]) |
| 59 | + amount-on-all-accounts (reduce (fn [collectibles-amount account] |
| 60 | + (+ collectibles-amount (:current-collectible-idx account))) |
| 61 | + 0 |
| 62 | + (vals accounts))] |
| 63 | + (key-value-event "collectibles-fetched" :total-amount amount-on-all-accounts))) |
| 64 | + |
| 65 | +(defn navigated-to-collectibles-tab-event |
| 66 | + [location] |
| 67 | + (key-value-event "navigated-to-collectibles-tab" :location location)) |
| 68 | + |
56 | 69 | (defn tracked-event
|
57 | 70 | [[event-name second-parameter] db]
|
58 |
| - (def dbg-db db) |
59 | 71 | (case event-name
|
60 | 72 | :profile/get-profiles-overview-success
|
61 | 73 | (user-journey-event app-started-event)
|
|
68 | 80 |
|
69 | 81 | :wallet/select-account-tab
|
70 | 82 | (when (= second-parameter :collectibles)
|
71 |
| - (key-value-event "navigated-to-collectibles-tab" :location :account)) |
| 83 | + (navigated-to-collectibles-tab-event :account)) |
| 84 | + |
| 85 | + :wallet/select-home-tab |
| 86 | + (when (= second-parameter :collectibles) |
| 87 | + (navigated-to-collectibles-tab-event :home)) |
72 | 88 |
|
73 | 89 | :wallet/flush-collectibles-fetched
|
74 |
| - (let [accounts (get-in db [:wallet :accounts]) |
75 |
| - total-amount (reduce (fn [collectibles-amount account] |
76 |
| - (+ collectibles-amount (:current-collectible-idx account))) |
77 |
| - 0 |
78 |
| - (vals accounts))] |
79 |
| - (key-value-event "collectibles-fetched" :total-amount total-amount)) |
| 90 | + (collectilbes-fetched-event db) |
80 | 91 |
|
81 |
| - |
82 |
| - ;; :centralized-metrics/navigated-to-collectibles-tab |
83 |
| - ;; (key-value-event "navigated-to-collectibles-tab" :location second-parameter) |
84 |
| - |
85 |
| - ;; :centralized-metrics/collectibles-fetched |
86 |
| - ;; (key-value-event "collectibles-fetched" :amount second-parameter) |
87 |
| - |
88 | 92 | nil))
|
89 |
| - |
90 |
| - |
91 |
| -(comment |
92 |
| - dbg-db |
93 |
| - (def accounts (get-in dbg-db [:wallet :accounts])) |
94 |
| - (:current-collectible-idx (second (vals accounts))) |
95 |
| - (reduce (fn [collectibles-amount account] |
96 |
| - (+ collectibles-amount (:current-collectible-idx account))) |
97 |
| - (vals accounts)) |
98 |
| - |
99 |
| - |
100 |
| - |
101 |
| - (reduce (fn [collectibles-amount account] |
102 |
| - (+ collectibles-amount (:current-collectible-idx account))) |
103 |
| - 0 |
104 |
| - (vals {:a {:current-collectible-idx 1} |
105 |
| - :b {:current-collectible-idx 1} |
106 |
| - }))) |
107 |
| - |
0 commit comments