Don't crash if token is missing referrals

Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
This commit is contained in:
Gheorghe Pinzaru 2020-11-05 20:19:07 +03:00
parent 6d104d60e2
commit 6311077cec
No known key found for this signature in database
GPG Key ID: C9A094959935A952
1 changed files with 6 additions and 2 deletions

View File

@ -56,9 +56,13 @@
(defn starter-pack []
(let [pack @(re-frame/subscribe [::invite/starter-pack])
tokens (utils/transform-tokens pack)
reward-text (cstr/join ", " (map (comp name :symbol first) tokens))]
reward-text (->> tokens
(map (comp :symbol first))
(filter (comp not nil?))
(map name)
(cstr/join ", "))]
[rn/view {:style (starter-pack-style)}
[rn/view {:style (styles/reward-tokens-icons (count tokens))}
[rn/view {:style (styles/reward-tokens-icons (count tokens))}
(doall
(for [[{name :name
{source :source} :icon} _ idx] tokens]