[15612] Only allow showing universal links after clicking start using status (#15786)

This commit is contained in:
Ibrahem Khalil 2023-05-09 10:49:25 +03:00 committed by GitHub
parent c78bdda717
commit ab973076eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 11 deletions

View File

@ -148,7 +148,8 @@
(rf/defn on-return-from-background (rf/defn on-return-from-background
[{:keys [db now] :as cofx}] [{:keys [db now] :as cofx}]
(let [app-in-background-since (get db :app-in-background-since) (let [new-account? (get db :onboarding-2/new-account?)
app-in-background-since (get db :app-in-background-since)
signed-up? (get-in db [:multiaccount :signed-up?]) signed-up? (get-in db [:multiaccount :signed-up?])
biometric-auth? (= (:auth-method db) "biometric") biometric-auth? (= (:auth-method db) "biometric")
requires-bio-auth (and requires-bio-auth (and
@ -161,7 +162,8 @@
{:db (dissoc db :app-in-background-since)} {:db (dissoc db :app-in-background-since)}
(mailserver/process-next-messages-request) (mailserver/process-next-messages-request)
(wallet/restart-wallet-service-after-background app-in-background-since) (wallet/restart-wallet-service-after-background app-in-background-since)
(universal-links/process-stored-event) (when-not new-account?
(universal-links/process-stored-event))
#(when-let [chat-id (:current-chat-id db)] #(when-let [chat-id (:current-chat-id db)]
{:dispatch [:chat/mark-all-as-read chat-id]}) {:dispatch [:chat/mark-all-as-read chat-id]})
#(when requires-bio-auth #(when requires-bio-auth

View File

@ -45,6 +45,7 @@
{:events [::messenger-started]} {:events [::messenger-started]}
[{:keys [db] :as cofx} {:keys [mailservers] :as response}] [{:keys [db] :as cofx} {:keys [mailservers] :as response}]
(log/info "Messenger started") (log/info "Messenger started")
(let [new-account? (get db :onboarding-2/new-account?)]
(rf/merge cofx (rf/merge cofx
{:db (-> db {:db (-> db
(assoc :messenger/started? true) (assoc :messenger/started? true)
@ -52,4 +53,5 @@
(fetch-node-info-fx) (fetch-node-info-fx)
(pairing/init) (pairing/init)
(stickers/load-packs) (stickers/load-packs)
(universal-links/process-stored-event))) (when-not new-account?
(universal-links/process-stored-event)))))

View File

@ -184,6 +184,7 @@
(rf/defn process-stored-event (rf/defn process-stored-event
"Return an event description for processing a url if in the database" "Return an event description for processing a url if in the database"
{:events [:universal-links/process-stored-event]}
[{:keys [db] :as cofx}] [{:keys [db] :as cofx}]
(when-let [url (:universal-links/url db)] (when-let [url (:universal-links/url db)]
(rf/merge cofx (rf/merge cofx

View File

@ -46,7 +46,9 @@
"Illustration here"]] "Illustration here"]]
[rn/view {:style (style/buttons insets)} [rn/view {:style (style/buttons insets)}
[quo/button [quo/button
{:on-press #(rf/dispatch [:init-root :shell-stack]) {:on-press (fn []
(rf/dispatch [:init-root :shell-stack])
(rf/dispatch [:universal-links/process-stored-event]))
:type :primary :type :primary
:accessibility-label :welcome-button :accessibility-label :welcome-button
:override-background-color (colors/custom-color profile-color 60)} :override-background-color (colors/custom-color profile-color 60)}