From f31e2b72e6eb75b63b1bcdc21633b75b00931c8f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 26 Nov 2024 20:34:57 +0100 Subject: [PATCH] :sparkles: Adjust data profile alias --- frontend/src/app/main.cljs | 18 +++++++++--------- frontend/src/app/main/data/auth.cljs | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/frontend/src/app/main.cljs b/frontend/src/app/main.cljs index 05d5aed59..d266422f6 100644 --- a/frontend/src/app/main.cljs +++ b/frontend/src/app/main.cljs @@ -12,7 +12,7 @@ [app.config :as cf] [app.main.data.auth :as da] [app.main.data.event :as ev] - [app.main.data.profile :as du] + [app.main.data.profile :as dp] [app.main.data.websocket :as ws] [app.main.errors] [app.main.features :as feat] @@ -67,14 +67,14 @@ authenticated user; proceed to fetch teams." [stream] (rx/merge - (rx/of (du/fetch-profile)) + (rx/of (dp/fetch-profile)) (->> stream - (rx/filter du/profile-fetched?) + (rx/filter dp/profile-fetched?) (rx/take 1) (rx/map deref) (rx/mapcat (fn [profile] - (if (du/is-authenticated? profile) - (rx/of (du/initialize-profile profile)) + (if (dp/is-authenticated? profile) + (rx/of (dp/initialize-profile profile)) (rx/empty)))) (rx/observe-on :async)))) @@ -95,22 +95,22 @@ ;; Watch for profile deletion events (->> stream - (rx/filter du/profile-deleted?) + (rx/filter dp/profile-deleted?) (rx/map da/logged-out)) ;; Once profile is fetched, initialize all penpot application ;; routes (->> stream - (rx/filter du/profile-fetched?) + (rx/filter dp/profile-fetched?) (rx/take 1) (rx/map #(rt/init-routes))) ;; Once profile fetched and the current user is authenticated, ;; proceed to initialize the websockets connection. (->> stream - (rx/filter du/profile-fetched?) + (rx/filter dp/profile-fetched?) (rx/map deref) - (rx/filter du/is-authenticated?) + (rx/filter dp/is-authenticated?) (rx/take 1) (rx/map #(ws/initialize))))))) diff --git a/frontend/src/app/main/data/auth.cljs b/frontend/src/app/main/data/auth.cljs index de5ec9a69..d25359073 100644 --- a/frontend/src/app/main/data/auth.cljs +++ b/frontend/src/app/main/data/auth.cljs @@ -14,7 +14,7 @@ [app.common.uuid :as uuid] [app.main.data.event :as ev] [app.main.data.notifications :as ntf] - [app.main.data.profile :as du] + [app.main.data.profile :as dp] [app.main.data.team :as dtm] [app.main.data.websocket :as ws] [app.main.repo :as rp] @@ -47,7 +47,7 @@ (if-let [file-id (get props :welcome-file-id)] (rx/of (rt/nav' :workspace {:project-id (:default-project-id profile) :file-id file-id}) - (du/update-profile-props {:welcome-file-id nil})) + (dp/update-profile-props {:welcome-file-id nil})) (let [teams (into #{} (map :id) teams) team-id (dtm/get-last-team-id) @@ -71,7 +71,7 @@ ptk/WatchEvent (watch [_ _ stream] (->> (rx/merge - (rx/of (du/initialize-profile profile) + (rx/of (dp/initialize-profile profile) (ws/initialize) (dtm/fetch-teams)) @@ -110,9 +110,9 @@ (->> (rp/cmd! :login-with-password (d/without-nils params)) (rx/merge-map (fn [data] (rx/merge - (rx/of (du/fetch-profile)) + (rx/of (dp/fetch-profile)) (->> stream - (rx/filter du/profile-fetched?) + (rx/filter dp/profile-fetched?) (rx/take 1) (rx/map deref) (rx/filter (complement is-authenticated?)) @@ -121,7 +121,7 @@ (rx/observe-on :async)) (->> stream - (rx/filter du/profile-fetched?) + (rx/filter dp/profile-fetched?) (rx/take 1) (rx/map deref) (rx/filter is-authenticated?) @@ -179,9 +179,9 @@ ptk/WatchEvent (watch [_ _ stream] (rx/merge - (rx/of (du/fetch-profile)) + (rx/of (dp/fetch-profile)) (->> stream - (rx/filter du/profile-fetched?) + (rx/filter dp/profile-fetched?) (rx/take 1) (rx/map deref) (rx/filter is-authenticated?)