added mixpanel events for profile
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
7001b8c396
commit
83b5312a05
|
@ -37,11 +37,14 @@
|
||||||
(def event-by-trigger (reduce-kv #(assoc %1 (:trigger %3) %3) {} events))
|
(def event-by-trigger (reduce-kv #(assoc %1 (:trigger %3) %3) {} events))
|
||||||
|
|
||||||
(defn matches? [event trigger]
|
(defn matches? [event trigger]
|
||||||
(if (= 1 (count trigger))
|
(cond (= 1 (count trigger))
|
||||||
(= (first event) (first trigger))
|
(= (first event) (first trigger))
|
||||||
(and
|
(= 2 (count trigger))
|
||||||
(= (first event) (first trigger))
|
(and
|
||||||
(= (second event) (second trigger)))))
|
(= (first event) (first trigger))
|
||||||
|
(= (second event) (second trigger)))
|
||||||
|
:else
|
||||||
|
(= event trigger)))
|
||||||
|
|
||||||
(defn matching-events [event definitions]
|
(defn matching-events [event definitions]
|
||||||
(reduce-kv #(if (matches? event %2) (conj %1 %3) %1) [] definitions))
|
(reduce-kv #(if (matches? event %2) (conj %1 %3) %1) [] definitions))
|
||||||
|
|
|
@ -148,4 +148,39 @@
|
||||||
:type :capture}}
|
:type :capture}}
|
||||||
{:label "Tap"
|
{:label "Tap"
|
||||||
:trigger [:navigate-to :profile-qr-viewer]
|
:trigger [:navigate-to :profile-qr-viewer]
|
||||||
:properties {:target :share-contact-code}}]
|
:properties {:target :share-contact-code}}
|
||||||
|
{:label "Tap"
|
||||||
|
:trigger [:set :my-profile/advanced? true]
|
||||||
|
:properties {:target :profile-advanced
|
||||||
|
:type :open}}
|
||||||
|
{:label "Tap"
|
||||||
|
:trigger [:set :my-profile/advanced? false]
|
||||||
|
:properties {:target :profile-advanced
|
||||||
|
:type :closed}}
|
||||||
|
{:label "Tap"
|
||||||
|
:trigger [:switch-dev-mode true]
|
||||||
|
:properties {:target :profile-dev-mode
|
||||||
|
:type :on}}
|
||||||
|
{:label "Tap"
|
||||||
|
:trigger [:switch-dev-mode false]
|
||||||
|
:properties {:target :profile-dev-mode
|
||||||
|
:type :off}}
|
||||||
|
{:label "Tap"
|
||||||
|
:trigger [:navigate-to :backup-seed]
|
||||||
|
:properties {:target :backup-your-seed-phrase}}
|
||||||
|
{:label "Tap"
|
||||||
|
:trigger [:set-in [:my-profile/seed :step] :12-words]
|
||||||
|
:properties {:target :seed-phrase
|
||||||
|
:type :welcome-ok}}
|
||||||
|
{:label "Tap"
|
||||||
|
:trigger [:my-profile/enter-two-random-words]
|
||||||
|
:properties {:target :seed-phrase
|
||||||
|
:type :step1-next}}
|
||||||
|
{:label "Tap"
|
||||||
|
:trigger [:my-profile/set-step :second-word]
|
||||||
|
:properties {:target :seed-phrase
|
||||||
|
:type :step2-next}}
|
||||||
|
{:label "Tap"
|
||||||
|
:trigger [:my-profile/finish]
|
||||||
|
:properties {:target :seed-phrase
|
||||||
|
:type :step3-done}}]
|
||||||
|
|
Loading…
Reference in New Issue