|
22 | 22 | (def ^:const app-started-event "app-started")
|
23 | 23 |
|
24 | 24 | (def ^:const view-ids-to-track
|
25 |
| - #{;; Tabs |
| 25 | + #{ ;; Tabs |
26 | 26 | :communities-stack
|
27 | 27 | :chats-stack
|
28 | 28 | :wallet-stack
|
|
54 | 54 | (navigation-event (name view-id))))
|
55 | 55 |
|
56 | 56 | (defn tracked-event
|
57 |
| - [[event-name second-parameter]] |
| 57 | + [[event-name second-parameter] db] |
| 58 | + (def dbg-db db) |
58 | 59 | (case event-name
|
59 | 60 | :profile/get-profiles-overview-success
|
60 | 61 | (user-journey-event app-started-event)
|
|
65 | 66 | :set-view-id
|
66 | 67 | (track-view-id-event second-parameter)
|
67 | 68 |
|
68 |
| - :centralized-metrics/navigated-to-collectibles-tab |
69 |
| - (key-value-event "navigated-to-collectibles-tab" :location second-parameter) |
| 69 | + :wallet/select-account-tab |
| 70 | + (when (= second-parameter :collectibles) |
| 71 | + (key-value-event "navigated-to-collectibles-tab" :location :account)) |
70 | 72 |
|
71 |
| - :centralized-metrics/collectibles-fetched |
72 |
| - (key-value-event "collectibles-fetched" :amount second-parameter) |
| 73 | + :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)) |
| 80 | + |
| 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) |
73 | 87 |
|
74 | 88 | 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