Set chaos mode every time, dont show the popup everytime

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
Andrea Maria Piana 2019-03-26 14:17:16 +01:00 committed by Igor Mandrigin
parent 581d27756e
commit 3eb570f082
No known key found for this signature in database
GPG Key ID: 4A0EDDE26E66BC8B
1 changed files with 11 additions and 11 deletions

View File

@ -180,17 +180,17 @@
:accounts.ui/chaos-mode-switched :accounts.ui/chaos-mode-switched
(fn [{:keys [db] :as cofx} [_ chaos-mode?]] (fn [{:keys [db] :as cofx} [_ chaos-mode?]]
(let [old-chaos-mode? (get-in db [:account/account :settings :chaos-mode?])] (let [old-chaos-mode? (get-in db [:account/account :settings :chaos-mode?])]
(when (not= old-chaos-mode? chaos-mode?) (fx/merge
(fx/merge cofx
cofx (when (and chaos-mode?
(when chaos-mode? (not= old-chaos-mode? chaos-mode?))
{:ui/show-confirmation {:ui/show-confirmation
{:title (i18n/label :t/chaos-unicorn-day) {:title (i18n/label :t/chaos-unicorn-day)
:content (i18n/label :t/chaos-unicorn-day-details) :content (i18n/label :t/chaos-unicorn-day-details)
:confirm-button-text (i18n/label :t/see-details) :confirm-button-text (i18n/label :t/see-details)
:cancel-button-text (i18n/label :t/cancel) :cancel-button-text (i18n/label :t/cancel)
:on-accept open-chaos-unicorn-day-link}}) :on-accept open-chaos-unicorn-day-link}})
(accounts/switch-chaos-mode chaos-mode?)))))) (accounts/switch-chaos-mode chaos-mode?)))))
(handlers/register-handler-fx (handlers/register-handler-fx
:accounts.ui/notifications-enabled :accounts.ui/notifications-enabled