added mixpanel events for profile

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
Andrey Shovkoplyas 2018-03-26 12:17:37 +03:00
parent 7001b8c396
commit 83b5312a05
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
2 changed files with 44 additions and 6 deletions

View File

@ -37,11 +37,14 @@
(def event-by-trigger (reduce-kv #(assoc %1 (:trigger %3) %3) {} events))
(defn matches? [event trigger]
(if (= 1 (count trigger))
(= (first event) (first trigger))
(and
(= (first event) (first trigger))
(= (second event) (second trigger)))))
(cond (= 1 (count trigger))
(= (first event) (first trigger))
(= 2 (count trigger))
(and
(= (first event) (first trigger))
(= (second event) (second trigger)))
:else
(= event trigger)))
(defn matching-events [event definitions]
(reduce-kv #(if (matches? event %2) (conj %1 %3) %1) [] definitions))

View File

@ -148,4 +148,39 @@
:type :capture}}
{:label "Tap"
: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}}]