From 2be432e1d4f8f6f55f5c8d2a926614fb4b31b639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Fri, 20 May 2022 16:33:42 +0200 Subject: [PATCH] :recycle: Remove obsolete st/emitf macro --- .../app/main/data/dashboard/shortcuts.cljs | 8 +- .../src/app/main/data/viewer/shortcuts.cljs | 16 +-- frontend/src/app/main/errors.cljs | 8 +- frontend/src/app/main/store.clj | 13 --- frontend/src/app/main/store.cljs | 5 - frontend/src/app/main/ui/auth/login.cljs | 2 +- frontend/src/app/main/ui/comments.cljs | 12 +- frontend/src/app/main/ui/dashboard.cljs | 2 +- .../app/main/ui/dashboard/change_owner.cljs | 2 +- .../src/app/main/ui/dashboard/file_menu.cljs | 4 +- frontend/src/app/main/ui/dashboard/files.cljs | 2 +- frontend/src/app/main/ui/dashboard/fonts.cljs | 4 +- .../src/app/main/ui/dashboard/libraries.cljs | 4 +- .../app/main/ui/dashboard/project_menu.cljs | 6 +- .../src/app/main/ui/dashboard/projects.cljs | 8 +- .../src/app/main/ui/dashboard/sidebar.cljs | 58 ++++----- frontend/src/app/main/ui/dashboard/team.cljs | 4 +- .../src/app/main/ui/dashboard/team_form.cljs | 2 +- frontend/src/app/main/ui/messages.cljs | 2 +- frontend/src/app/main/ui/releases.cljs | 7 +- .../app/main/ui/settings/change_email.cljs | 2 +- .../app/main/ui/settings/delete_account.cljs | 8 +- .../src/app/main/ui/settings/sidebar.cljs | 10 +- frontend/src/app/main/ui/static.cljs | 6 +- frontend/src/app/main/ui/viewer/comments.cljs | 2 +- .../ui/viewer/handoff/attributes/layout.cljs | 1 - frontend/src/app/main/ui/viewer/header.cljs | 12 +- .../app/main/ui/workspace/context_menu.cljs | 110 +++++++++--------- .../src/app/main/ui/workspace/header.cljs | 45 ++++--- .../app/main/ui/workspace/left_toolbar.cljs | 2 +- .../app/main/ui/workspace/sidebar/assets.cljs | 6 +- .../main/ui/workspace/sidebar/history.cljs | 2 +- .../workspace/sidebar/options/menus/bool.cljs | 2 +- .../sidebar/options/menus/component.cljs | 28 ++--- .../sidebar/options/menus/interactions.cljs | 8 +- .../sidebar/options/menus/typography.cljs | 8 +- .../main/ui/workspace/sidebar/sitemap.cljs | 10 +- .../main/ui/workspace/viewport/comments.cljs | 2 +- .../app/main/ui/workspace/viewport/hooks.cljs | 2 +- .../main/ui/workspace/viewport/widgets.cljs | 6 +- 40 files changed, 211 insertions(+), 230 deletions(-) delete mode 100644 frontend/src/app/main/store.clj diff --git a/frontend/src/app/main/data/dashboard/shortcuts.cljs b/frontend/src/app/main/data/dashboard/shortcuts.cljs index 78e085b0ba..6d4a555052 100644 --- a/frontend/src/app/main/data/dashboard/shortcuts.cljs +++ b/frontend/src/app/main/data/dashboard/shortcuts.cljs @@ -14,22 +14,22 @@ {:go-to-search {:tooltip (ds/meta "F") :command (ds/c-mod "f") :subsections [:navigation-dashboard] - :fn (st/emitf (dd/go-to-search))} + :fn #(st/emit! (dd/go-to-search))} :go-to-drafts {:tooltip "G D" :command "g d" :subsections [:navigation-dashboard] - :fn (st/emitf (dd/go-to-drafts))} + :fn #(st/emit! (dd/go-to-drafts))} :go-to-libs {:tooltip "G L" :command "g l" :subsections [:navigation-dashboard] - :fn (st/emitf (dd/go-to-libs))} + :fn #(st/emit! (dd/go-to-libs))} :create-new-project {:tooltip "+" :command "+" :subsections [:general-dashboard] - :fn (st/emitf (dd/create-element))}}) + :fn #(st/emit! (dd/create-element))}}) (defn get-tooltip [shortcut] (assert (contains? shortcuts shortcut) (str shortcut)) diff --git a/frontend/src/app/main/data/viewer/shortcuts.cljs b/frontend/src/app/main/data/viewer/shortcuts.cljs index e36216eeaf..4c3aa333ec 100644 --- a/frontend/src/app/main/data/viewer/shortcuts.cljs +++ b/frontend/src/app/main/data/viewer/shortcuts.cljs @@ -14,42 +14,42 @@ {:increase-zoom {:tooltip "+" :command "+" :subsections [:zoom-viewer] - :fn (st/emitf dv/increase-zoom)} + :fn #(st/emit! dv/increase-zoom)} :decrease-zoom {:tooltip "-" :command "-" :subsections [:zoom-viewer] - :fn (st/emitf dv/decrease-zoom)} + :fn #(st/emit! dv/decrease-zoom)} :select-all {:tooltip (ds/meta "A") :command (ds/c-mod "a") :subsections [:general-viewer] - :fn (st/emitf (dv/select-all))} + :fn #(st/emit! (dv/select-all))} :reset-zoom {:tooltip (ds/shift "0") :command "shift+0" :subsections [:zoom-viewer] - :fn (st/emitf dv/reset-zoom)} + :fn #(st/emit! dv/reset-zoom)} :toggle-zoom-style {:tooltip "F" :command "f" :subsections [:zoom-viewer] - :fn (st/emitf dv/toggle-zoom-style)} + :fn #(st/emit! dv/toggle-zoom-style)} :toogle-fullscreen {:tooltip (ds/shift "F") :command "shift+f" :subsections [:zoom-viewer] - :fn (st/emitf dv/toggle-fullscreen)} + :fn #(st/emit! dv/toggle-fullscreen)} :next-frame {:tooltip ds/left-arrow :command "left" :subsections [:general-viewer] - :fn (st/emitf dv/select-prev-frame)} + :fn #(st/emit! dv/select-prev-frame)} :prev-frame {:tooltip ds/right-arrow :command "right" :subsections [:general-viewer] - :fn (st/emitf dv/select-next-frame)} + :fn #(st/emit! dv/select-next-frame)} :open-handoff {:tooltip "G H" :command "g h" diff --git a/frontend/src/app/main/errors.cljs b/frontend/src/app/main/errors.cljs index bccbd506e0..604b0b039c 100644 --- a/frontend/src/app/main/errors.cljs +++ b/frontend/src/app/main/errors.cljs @@ -35,7 +35,7 @@ :else (let [hint (ex-message error) msg (dm/str "Internal Error: " hint)] - (ts/schedule (st/emitf (rt/assign-exception error))) + (ts/schedule #(st/emit! (rt/assign-exception error))) (js/console.group msg) (ex/ignoring (js/console.error error)) @@ -51,7 +51,7 @@ [_] (let [msg (tr "errors.auth.unable-to-login")] (st/emit! (du/logout {:capture-redirect true})) - (ts/schedule 500 (st/emitf (msg/warn msg))))) + (ts/schedule 500 #(st/emit! (msg/warn msg))))) ;; Error that happens on an active business model validation does not ;; passes an validation (example: profile can't leave a team). From @@ -154,7 +154,7 @@ (defmethod ptk/handle-error ::exceptional-state [error] (ts/schedule - (st/emitf (rt/assign-exception error)))) + #(st/emit! (rt/assign-exception error)))) ;; This happens when the backed server fails to process the ;; request. This can be caused by an internal assertion or any other @@ -188,7 +188,7 @@ (-> error ex-data ptk/handle-error) (let [hint (ex-message error) msg (dm/str "Unhandled Internal Error: " hint)] - (ts/schedule (st/emitf (rt/assign-exception error))) + (ts/schedule #(st/emit! (rt/assign-exception error))) (js/console.group msg) (ex/ignoring (js/console.error error)) (js/console.groupEnd msg)))) diff --git a/frontend/src/app/main/store.clj b/frontend/src/app/main/store.clj deleted file mode 100644 index bb2733a6dd..0000000000 --- a/frontend/src/app/main/store.clj +++ /dev/null @@ -1,13 +0,0 @@ -;; This Source Code Form is subject to the terms of the Mozilla Public -;; License, v. 2.0. If a copy of the MPL was not distributed with this -;; file, You can obtain one at http://mozilla.org/MPL/2.0/. -;; -;; Copyright (c) UXBOX Labs SL - -(ns app.main.store) - -(defmacro emitf - [& events] - `(fn [] - (app.main.store/emit! ~@events))) - diff --git a/frontend/src/app/main/store.cljs b/frontend/src/app/main/store.cljs index 01beedb9e0..c8d274c1c9 100644 --- a/frontend/src/app/main/store.cljs +++ b/frontend/src/app/main/store.cljs @@ -5,7 +5,6 @@ ;; Copyright (c) UXBOX Labs SL (ns app.main.store - (:require-macros [app.main.store]) (:require [app.util.object :as obj] [beicon.core :as rx] @@ -56,10 +55,6 @@ (apply ptk/emit! state (cons event events)) nil)) -(defn emitf - [& events] - #(apply ptk/emit! state events)) - (defonce ongoing-tasks (l/atom #{})) (add-watch ongoing-tasks ::ongoing-tasks diff --git a/frontend/src/app/main/ui/auth/login.cljs b/frontend/src/app/main/ui/auth/login.cljs index 41e2c7e712..e18f06c9d1 100644 --- a/frontend/src/app/main/ui/auth/login.cljs +++ b/frontend/src/app/main/ui/auth/login.cljs @@ -211,6 +211,6 @@ [:div.links.demo [:div.link-entry [:span (tr "auth.create-demo-profile") " "] - [:a {:on-click (st/emitf (du/create-demo-profile)) + [:a {:on-click #(st/emit! (du/create-demo-profile)) :data-test "demo-account-link"} (tr "auth.create-demo-account")]]])]]) diff --git a/frontend/src/app/main/ui/comments.cljs b/frontend/src/app/main/ui/comments.cljs index ad5619c95b..a7019d3627 100644 --- a/frontend/src/app/main/ui/comments.cljs +++ b/frontend/src/app/main/ui/comments.cljs @@ -204,19 +204,19 @@ on-delete-comment (mf/use-callback (mf/deps comment) - (st/emitf (dcm/delete-comment comment))) + #(st/emit! (dcm/delete-comment comment))) delete-thread (mf/use-callback (mf/deps thread) - (st/emitf (dcm/close-thread) - (dcm/delete-comment-thread thread))) + #(st/emit! (dcm/close-thread) + (dcm/delete-comment-thread thread))) on-delete-thread (mf/use-callback (mf/deps thread) - (st/emitf (modal/show + #(st/emit! (modal/show {:type :confirm :title (tr "modals.delete-comment-thread.title") :message (tr "modals.delete-comment-thread.message") @@ -292,11 +292,11 @@ (mf/use-layout-effect (mf/deps thread) - (st/emitf (dcm/retrieve-comments (:id thread)))) + #(st/emit! (dcm/retrieve-comments (:id thread)))) (mf/use-effect (mf/deps thread) - (st/emitf (dcm/update-comment-thread-status thread))) + #(st/emit! (dcm/update-comment-thread-status thread))) (mf/use-layout-effect (mf/deps thread comments-map) diff --git a/frontend/src/app/main/ui/dashboard.cljs b/frontend/src/app/main/ui/dashboard.cljs index 93ad158776..0f16ffaa8d 100644 --- a/frontend/src/app/main/ui/dashboard.cljs +++ b/frontend/src/app/main/ui/dashboard.cljs @@ -50,7 +50,7 @@ (mf/defc dashboard-content [{:keys [team projects project section search-term profile] :as props}] - [:div.dashboard-content {:on-click (st/emitf (dd/clear-selected-files))} + [:div.dashboard-content {:on-click #(st/emit! (dd/clear-selected-files))} (case section :dashboard-projects [:& projects-section {:team team :projects projects}] diff --git a/frontend/src/app/main/ui/dashboard/change_owner.cljs b/frontend/src/app/main/ui/dashboard/change_owner.cljs index a51624669f..8e7288f2eb 100644 --- a/frontend/src/app/main/ui/dashboard/change_owner.cljs +++ b/frontend/src/app/main/ui/dashboard/change_owner.cljs @@ -33,7 +33,7 @@ (filter #(not= (:label %) (:fullname profile)) (map #(hash-map :label (:name %) :value (str (:id %))) members))) - on-cancel (st/emitf (modal/hide)) + on-cancel #(st/emit! (modal/hide)) on-accept (fn [_] (let [member-id (get-in @form [:clean-data :member-id])] diff --git a/frontend/src/app/main/ui/dashboard/file_menu.cljs b/frontend/src/app/main/ui/dashboard/file_menu.cljs index 085f26b9bc..bbcdb74e05 100644 --- a/frontend/src/app/main/ui/dashboard/file_menu.cljs +++ b/frontend/src/app/main/ui/dashboard/file_menu.cljs @@ -126,10 +126,10 @@ {:on-success #(on-move-success team-id project-id)})))))) add-shared - (st/emitf (dd/set-file-shared (assoc file :is-shared true))) + #(st/emit! (dd/set-file-shared (assoc file :is-shared true))) del-shared - (st/emitf (dd/set-file-shared (assoc file :is-shared false))) + #(st/emit! (dd/set-file-shared (assoc file :is-shared false))) on-add-shared (fn [event] diff --git a/frontend/src/app/main/ui/dashboard/files.cljs b/frontend/src/app/main/ui/dashboard/files.cljs index 770b67f54f..3f7c7bcbb8 100644 --- a/frontend/src/app/main/ui/dashboard/files.cljs +++ b/frontend/src/app/main/ui/dashboard/files.cljs @@ -39,7 +39,7 @@ toggle-pin (mf/use-callback (mf/deps project) - (st/emitf (dd/toggle-project-pin project))) + #(st/emit! (dd/toggle-project-pin project))) on-create-clicked (mf/use-callback diff --git a/frontend/src/app/main/ui/dashboard/fonts.cljs b/frontend/src/app/main/ui/dashboard/fonts.cljs index 706bc1fb68..732aa0e4ad 100644 --- a/frontend/src/app/main/ui/dashboard/fonts.cljs +++ b/frontend/src/app/main/ui/dashboard/fonts.cljs @@ -41,12 +41,12 @@ ;; (let [go-fonts ;; (mf/use-callback ;; (mf/deps team) - ;; (st/emitf (rt/nav :dashboard-fonts {:team-id (:id team)}))) + ;; #(st/emit! (rt/nav :dashboard-fonts {:team-id (:id team)}))) ;; go-providers ;; (mf/use-callback ;; (mf/deps team) - ;; (st/emitf (rt/nav :dashboard-font-providers {:team-id (:id team)})))] + ;; #(st/emit! (rt/nav :dashboard-font-providers {:team-id (:id team)})))] (use-set-page-title team section) diff --git a/frontend/src/app/main/ui/dashboard/libraries.cljs b/frontend/src/app/main/ui/dashboard/libraries.cljs index 618855c2c2..80245771e6 100644 --- a/frontend/src/app/main/ui/dashboard/libraries.cljs +++ b/frontend/src/app/main/ui/dashboard/libraries.cljs @@ -33,8 +33,8 @@ (dom/set-html-title (tr "title.dashboard.shared-libraries" tname)))))) (mf/use-effect - (st/emitf (dd/fetch-shared-files) - (dd/clear-selected-files))) + #(st/emit! (dd/fetch-shared-files) + (dd/clear-selected-files))) [:* [:header.dashboard-header diff --git a/frontend/src/app/main/ui/dashboard/project_menu.cljs b/frontend/src/app/main/ui/dashboard/project_menu.cljs index c374ef16de..dc24db23c7 100644 --- a/frontend/src/app/main/ui/dashboard/project_menu.cljs +++ b/frontend/src/app/main/ui/dashboard/project_menu.cljs @@ -56,7 +56,7 @@ (with-meta project {:on-success on-duplicate-success})))) toggle-pin - (st/emitf (dd/toggle-project-pin project)) + #(st/emit! (dd/toggle-project-pin project)) on-move-success (fn [team-id] @@ -66,7 +66,7 @@ (fn [team-id] (let [data {:id (:id project) :team-id team-id} mdata {:on-success #(on-move-success team-id)}] - (st/emitf (dm/success (tr "dashboard.success-move-project")) + #(st/emit! (dm/success (tr "dashboard.success-move-project")) (dd/move-project (with-meta data mdata))))) delete-fn @@ -76,7 +76,7 @@ (dd/go-to-projects (:team-id project)))) on-delete - (st/emitf + #(st/emit! (modal/show {:type :confirm :title (tr "modals.delete-project-confirm.title") diff --git a/frontend/src/app/main/ui/dashboard/projects.cljs b/frontend/src/app/main/ui/dashboard/projects.cljs index b8352a11f4..18ceabe63f 100644 --- a/frontend/src/app/main/ui/dashboard/projects.cljs +++ b/frontend/src/app/main/ui/dashboard/projects.cljs @@ -25,7 +25,7 @@ (mf/defc header {::mf/wrap [mf/memo]} [] - (let [create (st/emitf (dd/create-project))] + (let [create #(st/emit! (dd/create-project))] [:header.dashboard-header [:div.dashboard-title [:h1 (tr "dashboard.projects-title")]] @@ -49,13 +49,13 @@ on-nav (mf/use-callback (mf/deps project) - (st/emitf (rt/nav :dashboard-files {:team-id (:team-id project) - :project-id (:id project)}))) + #(st/emit! (rt/nav :dashboard-files {:team-id (:team-id project) + :project-id (:id project)}))) toggle-pin (mf/use-callback (mf/deps project) - (st/emitf (dd/toggle-project-pin project))) + #(st/emit! (dd/toggle-project-pin project))) on-menu-click (mf/use-callback (fn [event] diff --git a/frontend/src/app/main/ui/dashboard/sidebar.cljs b/frontend/src/app/main/ui/dashboard/sidebar.cljs index 382e96d6d9..1bf667f81a 100644 --- a/frontend/src/app/main/ui/dashboard/sidebar.cljs +++ b/frontend/src/app/main/ui/dashboard/sidebar.cljs @@ -102,8 +102,8 @@ on-drop-success (mf/use-callback (mf/deps (:id item)) - (st/emitf (msg/success (tr "dashboard.success-move-file")) - (dd/go-to-files (:id item)))) + #(st/emit! (msg/success (tr "dashboard.success-move-file")) + (dd/go-to-files (:id item)))) on-drop (mf/use-callback @@ -209,7 +209,7 @@ on-create-clicked (mf/use-callback - (st/emitf (modal/show :team-form {}))) + #(st/emit! (modal/show :team-form {}))) team-selected (mf/use-callback @@ -240,9 +240,9 @@ (mf/defc team-options-dropdown [{:keys [team profile] :as props}] - (let [go-members (st/emitf (dd/go-to-team-members)) - go-invitations (st/emitf (dd/go-to-team-invitations)) - go-settings (st/emitf (dd/go-to-team-settings)) + (let [go-members #(st/emit! (dd/go-to-team-members)) + go-invitations #(st/emit! (dd/go-to-team-invitations)) + go-settings #(st/emit! (dd/go-to-team-settings)) members-map (mf/deref refs/dashboard-team-members) members (vals members-map) @@ -283,12 +283,12 @@ (st/emit! (modal/show :team-form {:team team}))) on-leave-clicked - (st/emitf (modal/show - {:type :confirm - :title (tr "modals.leave-confirm.title") - :message (tr "modals.leave-confirm.message") - :accept-label (tr "modals.leave-confirm.accept") - :on-accept leave-fn})) + #(st/emit! (modal/show + {:type :confirm + :title (tr "modals.leave-confirm.title") + :message (tr "modals.leave-confirm.message") + :accept-label (tr "modals.leave-confirm.accept") + :on-accept leave-fn})) on-leave-as-owner-clicked (fn [] @@ -300,22 +300,22 @@ :accept leave-fn}))) leave-and-close - (st/emitf (modal/show - {:type :confirm - :title (tr "modals.leave-confirm.title") - :message (tr "modals.leave-and-close-confirm.message" (:name team)) - :scd-message (tr "modals.leave-and-close-confirm.hint") - :accept-label (tr "modals.leave-confirm.accept") - :on-accept delete-fn})) + #(st/emit! (modal/show + {:type :confirm + :title (tr "modals.leave-confirm.title") + :message (tr "modals.leave-and-close-confirm.message" (:name team)) + :scd-message (tr "modals.leave-and-close-confirm.hint") + :accept-label (tr "modals.leave-confirm.accept") + :on-accept delete-fn})) on-delete-clicked - (st/emitf - (modal/show - {:type :confirm - :title (tr "modals.delete-team-confirm.title") - :message (tr "modals.delete-team-confirm.message") - :accept-label (tr "modals.delete-team-confirm.accept") - :on-accept delete-fn}))] + #(st/emit! + (modal/show + {:type :confirm + :title (tr "modals.delete-team-confirm.title") + :message (tr "modals.delete-team-confirm.message") + :accept-label (tr "modals.delete-team-confirm.accept") + :on-accept delete-fn}))] [:ul.dropdown.options-dropdown [:li {:on-click go-members :data-test "team-members"} (tr "labels.members")] @@ -391,12 +391,12 @@ go-projects (mf/use-callback (mf/deps team) - (st/emitf (rt/nav :dashboard-projects {:team-id (:id team)}))) + #(st/emit! (rt/nav :dashboard-projects {:team-id (:id team)}))) go-fonts (mf/use-callback (mf/deps team) - (st/emitf (rt/nav :dashboard-fonts {:team-id (:id team)}))) + #(st/emit! (rt/nav :dashboard-fonts {:team-id (:id team)}))) go-drafts (mf/use-callback @@ -408,7 +408,7 @@ go-libs (mf/use-callback (mf/deps team) - (st/emitf (rt/nav :dashboard-libraries {:team-id (:id team)}))) + #(st/emit! (rt/nav :dashboard-libraries {:team-id (:id team)}))) pinned-projects (->> (vals projects) diff --git a/frontend/src/app/main/ui/dashboard/team.cljs b/frontend/src/app/main/ui/dashboard/team.cljs index 905879eff3..939b6e2d1a 100644 --- a/frontend/src/app/main/ui/dashboard/team.cljs +++ b/frontend/src/app/main/ui/dashboard/team.cljs @@ -592,8 +592,8 @@ (mf/use-effect - (st/emitf (dd/fetch-team-members) - (dd/fetch-team-stats))) + #(st/emit! (dd/fetch-team-members) + (dd/fetch-team-stats))) [:* [:& header {:section :dashboard-team-settings diff --git a/frontend/src/app/main/ui/dashboard/team_form.cljs b/frontend/src/app/main/ui/dashboard/team_form.cljs index d7088c0303..12f092b9ba 100644 --- a/frontend/src/app/main/ui/dashboard/team_form.cljs +++ b/frontend/src/app/main/ui/dashboard/team_form.cljs @@ -82,7 +82,7 @@ [:h2 (tr "labels.create-team")])] [:div.modal-close-button - {:on-click (st/emitf (modal/hide))} i/close]] + {:on-click #(st/emit! (modal/hide))} i/close]] [:div.modal-content.generic-form [:& fm/input {:type "text" diff --git a/frontend/src/app/main/ui/messages.cljs b/frontend/src/app/main/ui/messages.cljs index 7325580dad..a58e0f4677 100644 --- a/frontend/src/app/main/ui/messages.cljs +++ b/frontend/src/app/main/ui/messages.cljs @@ -49,7 +49,7 @@ (mf/defc notifications [] (let [message (mf/deref refs/message) - on-close (st/emitf dm/hide)] + on-close #(st/emit! dm/hide)] (when message [:& banner (assoc message :position (or (:position message) :fixed) diff --git a/frontend/src/app/main/ui/releases.cljs b/frontend/src/app/main/ui/releases.cljs index a75dcfe3ad..93f7310a70 100644 --- a/frontend/src/app/main/ui/releases.cljs +++ b/frontend/src/app/main/ui/releases.cljs @@ -44,14 +44,13 @@ finish (mf/use-callback - (st/emitf (modal/hide) - (du/mark-onboarding-as-viewed {:version version}))) - ] + #(st/emit! (modal/hide) + (du/mark-onboarding-as-viewed {:version version})))] (mf/use-effect (mf/deps) (fn [] - (st/emitf (du/mark-onboarding-as-viewed {:version version})))) + #(st/emit! (du/mark-onboarding-as-viewed {:version version})))) (mf/use-layout-effect (mf/deps @slide) diff --git a/frontend/src/app/main/ui/settings/change_email.cljs b/frontend/src/app/main/ui/settings/change_email.cljs index 0574499096..af0e76d6ee 100644 --- a/frontend/src/app/main/ui/settings/change_email.cljs +++ b/frontend/src/app/main/ui/settings/change_email.cljs @@ -77,7 +77,7 @@ :validators [email-equality] :initial profile) on-close - (mf/use-callback (st/emitf (modal/hide)))] + (mf/use-callback #(st/emit! (modal/hide)))] [:div.modal-overlay [:div.modal-container.change-email-modal.form-container diff --git a/frontend/src/app/main/ui/settings/delete_account.cljs b/frontend/src/app/main/ui/settings/delete_account.cljs index 886d966800..3538e1c42b 100644 --- a/frontend/src/app/main/ui/settings/delete_account.cljs +++ b/frontend/src/app/main/ui/settings/delete_account.cljs @@ -28,13 +28,13 @@ ::mf/register-as :delete-account} [] (let [on-close - (mf/use-callback (st/emitf (modal/hide))) + (mf/use-callback #(st/emit! (modal/hide))) on-accept (mf/use-callback - (st/emitf (modal/hide) - (du/request-account-deletion - (with-meta {} {:on-error on-error}))))] + #(st/emit! (modal/hide) + (du/request-account-deletion + (with-meta {} {:on-error on-error}))))] [:div.modal-overlay [:div.modal-container.change-email-modal diff --git a/frontend/src/app/main/ui/settings/sidebar.cljs b/frontend/src/app/main/ui/settings/sidebar.cljs index 3a5504fe93..06ed616ad0 100644 --- a/frontend/src/app/main/ui/settings/sidebar.cljs +++ b/frontend/src/app/main/ui/settings/sidebar.cljs @@ -29,27 +29,27 @@ go-dashboard (mf/use-callback (mf/deps profile) - (st/emitf (rt/nav :dashboard-projects {:team-id (du/get-current-team-id profile)}))) + #(st/emit! (rt/nav :dashboard-projects {:team-id (du/get-current-team-id profile)}))) go-settings-profile (mf/use-callback (mf/deps profile) - (st/emitf (rt/nav :settings-profile))) + #(st/emit! (rt/nav :settings-profile))) go-settings-feedback (mf/use-callback (mf/deps profile) - (st/emitf (rt/nav :settings-feedback))) + #(st/emit! (rt/nav :settings-feedback))) go-settings-password (mf/use-callback (mf/deps profile) - (st/emitf (rt/nav :settings-password))) + #(st/emit! (rt/nav :settings-password))) go-settings-options (mf/use-callback (mf/deps profile) - (st/emitf (rt/nav :settings-options))) + #(st/emit! (rt/nav :settings-options))) show-release-notes (mf/use-callback diff --git a/frontend/src/app/main/ui/static.cljs b/frontend/src/app/main/ui/static.cljs index e604a4a5b2..3d8622e169 100644 --- a/frontend/src/app/main/ui/static.cljs +++ b/frontend/src/app/main/ui/static.cljs @@ -41,7 +41,7 @@ [:div.desc-message (tr "labels.bad-gateway.desc-message")] [:div.sign-info [:a.btn-primary.btn-small - {:on-click (st/emitf #(dissoc % :exception))} + {:on-click (fn [] (st/emit! #(dissoc % :exception)))} (tr "labels.retry")]]]) (mf/defc service-unavailable @@ -52,7 +52,7 @@ [:div.desc-message (tr "labels.service-unavailable.desc-message")] [:div.sign-info [:a.btn-primary.btn-small - {:on-click (st/emitf #(dissoc % :exception))} + {:on-click (fn [] (st/emit! #(dissoc % :exception)))} (tr "labels.retry")]]]) (mf/defc internal-error @@ -63,7 +63,7 @@ [:div.desc-message (tr "labels.internal-error.desc-message")] [:div.sign-info [:a.btn-primary.btn-small - {:on-click (st/emitf (rt/assign-exception nil))} + {:on-click (fn [] (st/emit! (rt/assign-exception nil)))} (tr "labels.retry")]]]) (mf/defc exception-page diff --git a/frontend/src/app/main/ui/viewer/comments.cljs b/frontend/src/app/main/ui/viewer/comments.cljs index 44cd264afc..c813485fbd 100644 --- a/frontend/src/app/main/ui/viewer/comments.cljs +++ b/frontend/src/app/main/ui/viewer/comments.cljs @@ -122,7 +122,7 @@ on-draft-cancel (mf/use-callback (mf/deps cstate) - (st/emitf (dcm/close-thread))) + #(st/emit! (dcm/close-thread))) on-draft-submit (mf/use-callback diff --git a/frontend/src/app/main/ui/viewer/handoff/attributes/layout.cljs b/frontend/src/app/main/ui/viewer/handoff/attributes/layout.cljs index e6dd45711d..f2fca42b8c 100644 --- a/frontend/src/app/main/ui/viewer/handoff/attributes/layout.cljs +++ b/frontend/src/app/main/ui/viewer/handoff/attributes/layout.cljs @@ -11,7 +11,6 @@ [app.main.ui.formats :as fmt] [app.util.code-gen :as cg] [app.util.i18n :refer [tr]] - [app.util.strings :as ust] [cuerdas.core :as str] [rumext.alpha :as mf])) diff --git a/frontend/src/app/main/ui/viewer/header.cljs b/frontend/src/app/main/ui/viewer/header.cljs index 257b4f8d84..ad5f2e49cf 100644 --- a/frontend/src/app/main/ui/viewer/header.cljs +++ b/frontend/src/app/main/ui/viewer/header.cljs @@ -92,11 +92,11 @@ [:& export-progress-widget] [:& zoom-widget {:zoom zoom - :on-increase (st/emitf dv/increase-zoom) - :on-decrease (st/emitf dv/decrease-zoom) - :on-zoom-reset (st/emitf dv/reset-zoom) - :on-zoom-fill (st/emitf dv/zoom-to-fill) - :on-zoom-fit (st/emitf dv/zoom-to-fit) + :on-increase #(st/emit! dv/increase-zoom) + :on-decrease #(st/emit! dv/decrease-zoom) + :on-zoom-reset #(st/emit! dv/reset-zoom) + :on-zoom-fill #(st/emit! dv/zoom-to-fill) + :on-zoom-fit #(st/emit! dv/zoom-to-fit) :on-fullscreen toggle-fullscreen}] [:span.btn-icon-dark.btn-small.tooltip.tooltip-bottom-left @@ -172,7 +172,7 @@ (mf/defc header [{:keys [project file page frame zoom section permissions index]}] (let [go-to-dashboard - (st/emitf (dv/go-to-dashboard)) + #(st/emit! (dv/go-to-dashboard)) go-to-handoff (fn [] diff --git a/frontend/src/app/main/ui/workspace/context_menu.cljs b/frontend/src/app/main/ui/workspace/context_menu.cljs index 697a6b369e..669e5cf91d 100644 --- a/frontend/src/app/main/ui/workspace/context_menu.cljs +++ b/frontend/src/app/main/ui/workspace/context_menu.cljs @@ -101,11 +101,11 @@ (mf/defc context-menu-edit [] - (let [do-copy (st/emitf (dw/copy-selected)) - do-cut (st/emitf (dw/copy-selected) - (dw/delete-selected)) - do-paste (st/emitf dw/paste) - do-duplicate (st/emitf (dw/duplicate-selected false))] + (let [do-copy #(st/emit! (dw/copy-selected)) + do-cut #(st/emit! (dw/copy-selected) + (dw/delete-selected)) + do-paste #(st/emit! dw/paste) + do-duplicate #(st/emit! (dw/duplicate-selected false))] [:* [:& menu-entry {:title (tr "workspace.shape.menu.copy") :shortcut (sc/get-tooltip :copy) @@ -124,11 +124,11 @@ (mf/defc context-menu-layer-position [{:keys [hover-objs shapes]}] - (let [do-bring-forward (st/emitf (dw/vertical-order-selected :up)) - do-bring-to-front (st/emitf (dw/vertical-order-selected :top)) - do-send-backward (st/emitf (dw/vertical-order-selected :down)) - do-send-to-back (st/emitf (dw/vertical-order-selected :bottom)) - select-shapes (fn [id] (st/emitf (dws/select-shape id)))] + (let [do-bring-forward #(st/emit! (dw/vertical-order-selected :up)) + do-bring-to-front #(st/emit! (dw/vertical-order-selected :top)) + do-send-backward #(st/emit! (dw/vertical-order-selected :down)) + do-send-to-back #(st/emit! (dw/vertical-order-selected :bottom)) + select-shapes (fn [id] #(st/emit! (dws/select-shape id)))] [:* (when (> (count hover-objs) 1) [:& menu-entry {:title (tr "workspace.shape.menu.select-layer")} @@ -154,8 +154,8 @@ (mf/defc context-menu-flip [] - (let [do-flip-vertical (st/emitf (dw/flip-vertical-selected)) - do-flip-horizontal (st/emitf (dw/flip-horizontal-selected))] + (let [do-flip-vertical #(st/emit! (dw/flip-vertical-selected)) + do-flip-horizontal #(st/emit! (dw/flip-horizontal-selected))] [:* [:& menu-entry {:title (tr "workspace.shape.menu.flip-vertical") :shortcut (sc/get-tooltip :flip-vertical) @@ -170,7 +170,7 @@ [{:keys [shapes]}] (let [single? (= (count shapes) 1) has-frame? (some cph/frame-shape? shapes) - do-toggle-thumbnail (st/emitf (dw/toggle-file-thumbnail-selected))] + do-toggle-thumbnail #(st/emit! (dw/toggle-file-thumbnail-selected))] (when (and single? has-frame?) [:* (if (every? :use-for-thumbnail? shapes) @@ -186,7 +186,7 @@ (let [multiple? (> (count shapes) 1) single? (= (count shapes) 1) - do-create-artboard-from-selection (st/emitf (dw/create-artboard-from-selection)) + do-create-artboard-from-selection #(st/emit! (dw/create-artboard-from-selection)) has-group? (->> shapes (d/seek #(= :group (:type %)))) has-bool? (->> shapes (d/seek #(= :bool (:type %)))) @@ -196,10 +196,10 @@ is-group? (and single? has-group?) is-bool? (and single? has-bool?) - do-create-group (st/emitf dw/group-selected) - do-mask-group (st/emitf dw/mask-group) - do-remove-group (st/emitf dw/ungroup-selected) - do-unmask-group (st/emitf dw/unmask-group)] + do-create-group #(st/emit! dw/group-selected) + do-mask-group #(st/emit! dw/mask-group) + do-remove-group #(st/emit! dw/ungroup-selected) + do-unmask-group #(st/emit! dw/unmask-group)] [:* (when (or has-bool? has-group? has-mask?) @@ -253,8 +253,8 @@ is-bool? (and single? has-bool?) is-frame? (and single? has-frame?) - do-start-editing #(timers/schedule (st/emitf (dw/start-editing-selected))) - do-transform-to-path (st/emitf (dw/convert-selected-to-path)) + do-start-editing (fn [] (timers/schedule #(st/emit! (dw/start-editing-selected)))) + do-transform-to-path #(st/emit! (dw/convert-selected-to-path)) make-do-bool (fn [bool-type] @@ -302,10 +302,10 @@ (mf/defc context-menu-layer-options [{:keys [shapes]}] (let [ids (mapv :id shapes) - do-show-shape (st/emitf (dw/update-shape-flags ids {:hidden false})) - do-hide-shape (st/emitf (dw/update-shape-flags ids {:hidden true})) - do-lock-shape (st/emitf (dw/update-shape-flags ids {:blocked true})) - do-unlock-shape (st/emitf (dw/update-shape-flags ids {:blocked false}))] + do-show-shape #(st/emit! (dw/update-shape-flags ids {:hidden false})) + do-hide-shape #(st/emit! (dw/update-shape-flags ids {:hidden true})) + do-lock-shape #(st/emit! (dw/update-shape-flags ids {:blocked true})) + do-unlock-shape #(st/emit! (dw/update-shape-flags ids {:blocked false}))] [:* (if (every? :hidden shapes) [:& menu-entry {:title (tr "workspace.shape.menu.show") @@ -323,8 +323,8 @@ [{:keys [shapes]}] (let [options (mf/deref refs/workspace-page-options) options-mode (mf/deref refs/options-mode) - do-add-flow (st/emitf (dwi/add-flow-selected-frame)) - do-remove-flow #(st/emitf (dwi/remove-flow (:id %))) + do-add-flow #(st/emit! (dwi/add-flow-selected-frame)) + do-remove-flow #(st/emit! (dwi/remove-flow (:id %))) flows (:flows options) prototype? (= options-mode :prototype) @@ -357,36 +357,36 @@ current-file-id (mf/use-ctx ctx/current-file-id) local-component? (= component-file current-file-id) - do-add-component (st/emitf (dwl/add-component)) - do-detach-component (st/emitf (dwl/detach-component shape-id)) - do-detach-component-in-bulk (st/emitf dwl/detach-selected-components) - do-reset-component (st/emitf (dwl/reset-component shape-id)) - do-show-component (st/emitf (dw/go-to-component component-id)) - do-navigate-component-file (st/emitf (dwl/nav-to-component-file component-file)) - do-update-component (st/emitf (dwl/update-component-sync shape-id component-file)) - do-update-component-in-bulk (st/emitf (dwl/update-component-in-bulk component-shapes component-file)) + do-add-component #(st/emit! (dwl/add-component)) + do-detach-component #(st/emit! (dwl/detach-component shape-id)) + do-detach-component-in-bulk #(st/emit! dwl/detach-selected-components) + do-reset-component #(st/emit! (dwl/reset-component shape-id)) + do-show-component #(st/emit! (dw/go-to-component component-id)) + do-navigate-component-file #(st/emit! (dwl/nav-to-component-file component-file)) + do-update-component #(st/emit! (dwl/update-component-sync shape-id component-file)) + do-update-component-in-bulk #(st/emit! (dwl/update-component-in-bulk component-shapes component-file)) do-update-remote-component - (st/emitf (modal/show - {:type :confirm - :message "" - :title (tr "modals.update-remote-component.message") - :hint (tr "modals.update-remote-component.hint") - :cancel-label (tr "modals.update-remote-component.cancel") - :accept-label (tr "modals.update-remote-component.accept") - :accept-style :primary - :on-accept do-update-component})) + #(st/emit! (modal/show + {:type :confirm + :message "" + :title (tr "modals.update-remote-component.message") + :hint (tr "modals.update-remote-component.hint") + :cancel-label (tr "modals.update-remote-component.cancel") + :accept-label (tr "modals.update-remote-component.accept") + :accept-style :primary + :on-accept do-update-component})) - do-update-in-bulk (st/emitf (modal/show - {:type :confirm - :message "" - :title (tr "modals.update-remote-component-in-bulk.message") - :hint (tr "modals.update-remote-component-in-bulk.hint") - :items component-shapes - :cancel-label (tr "modals.update-remote-component.cancel") - :accept-label (tr "modals.update-remote-component.accept") - :accept-style :primary - :on-accept do-update-component-in-bulk}))] + do-update-in-bulk #(st/emit! (modal/show + {:type :confirm + :message "" + :title (tr "modals.update-remote-component-in-bulk.message") + :hint (tr "modals.update-remote-component-in-bulk.hint") + :items component-shapes + :cancel-label (tr "modals.update-remote-component.cancel") + :accept-label (tr "modals.update-remote-component.accept") + :accept-style :primary + :on-accept do-update-component-in-bulk}))] [:* (when (and (not has-frame?) (not is-component?)) [:* @@ -433,7 +433,7 @@ (mf/defc context-menu-delete [] - (let [do-delete (st/emitf (dw/delete-selected))] + (let [do-delete #(st/emit! (dw/delete-selected))] [:& menu-entry {:title (tr "workspace.shape.menu.delete") :shortcut (sc/get-tooltip :delete) :on-click do-delete}])) @@ -504,7 +504,7 @@ (.setAttribute ^js dropdown "style" new-style)))))) [:& dropdown {:show (boolean mdata) - :on-close (st/emitf dw/hide-context-menu)} + :on-close #(st/emit! dw/hide-context-menu)} [:ul.workspace-context-menu {:ref dropdown-ref :style {:top top :left left} diff --git a/frontend/src/app/main/ui/workspace/header.cljs b/frontend/src/app/main/ui/workspace/header.cljs index 504d8d910f..7346b2327c 100644 --- a/frontend/src/app/main/ui/workspace/header.cljs +++ b/frontend/src/app/main/ui/workspace/header.cljs @@ -112,36 +112,35 @@ frames (mf/deref refs/workspace-frames) add-shared-fn - (st/emitf (dwl/set-file-shared (:id file) true)) + #(st/emit! (dwl/set-file-shared (:id file) true)) del-shared-fn - (st/emitf (dwl/set-file-shared (:id file) false)) + #(st/emit! (dwl/set-file-shared (:id file) false)) on-add-shared (mf/use-fn (mf/deps file) - (st/emitf (modal/show - {:type :confirm - :message "" - :title (tr "modals.add-shared-confirm.message" (:name file)) - :hint (tr "modals.add-shared-confirm.hint") - :cancel-label :omit - :accept-label (tr "modals.add-shared-confirm.accept") - :accept-style :primary - :on-accept add-shared-fn}))) + #(st/emit! (modal/show + {:type :confirm + :message "" + :title (tr "modals.add-shared-confirm.message" (:name file)) + :hint (tr "modals.add-shared-confirm.hint") + :cancel-label :omit + :accept-label (tr "modals.add-shared-confirm.accept") + :accept-style :primary + :on-accept add-shared-fn}))) on-remove-shared (mf/use-fn (mf/deps file) - (st/emitf (modal/show - {:type :confirm - :message "" - :title (tr "modals.remove-shared-confirm.message" (:name file)) - :hint (tr "modals.remove-shared-confirm.hint") - :cancel-label :omit - :accept-label (tr "modals.remove-shared-confirm.accept") - :on-accept del-shared-fn}))) - + #(st/emit! (modal/show + {:type :confirm + :message "" + :title (tr "modals.remove-shared-confirm.message" (:name file)) + :hint (tr "modals.remove-shared-confirm.hint") + :cancel-label :omit + :accept-label (tr "modals.remove-shared-confirm.accept") + :on-accept del-shared-fn}))) handle-blur (fn [_] (let [value (-> edit-input-ref mf/ref-val dom/get-value)] @@ -420,7 +419,7 @@ (when (contains? @cf/flags :user-feedback) [:* - [:li.feedback {:on-click (st/emitf (rt/nav-new-window* {:rname :settings-feedback}))} + [:li.feedback {:on-click #(st/emit! (rt/nav-new-window* {:rname :settings-feedback}))} [:span (tr "labels.give-feedback")]]])]]])) ;; --- Header Component @@ -434,12 +433,12 @@ go-back (mf/use-callback (mf/deps project) - (st/emitf (dw/go-to-dashboard project))) + #(st/emit! (dw/go-to-dashboard project))) go-viewer (mf/use-callback (mf/deps file page-id) - (st/emitf (dw/go-to-viewer params)))] + #(st/emit! (dw/go-to-viewer params)))] [:header.workspace-header [:div.left-area diff --git a/frontend/src/app/main/ui/workspace/left_toolbar.cljs b/frontend/src/app/main/ui/workspace/left_toolbar.cljs index 6c3d000b90..106e6f775f 100644 --- a/frontend/src/app/main/ui/workspace/left_toolbar.cljs +++ b/frontend/src/app/main/ui/workspace/left_toolbar.cljs @@ -73,7 +73,7 @@ {:alt (tr "workspace.toolbar.move" (sc/get-tooltip :move)) :class (when (and (nil? selected-drawtool) (not edition)) "selected") - :on-click (st/emitf :interrupt)} + :on-click #(st/emit! :interrupt)} i/pointer-inner] [:li.tooltip.tooltip-right {:alt (tr "workspace.toolbar.frame" (sc/get-tooltip :draw-frame)) diff --git a/frontend/src/app/main/ui/workspace/sidebar/assets.cljs b/frontend/src/app/main/ui/workspace/sidebar/assets.cljs index ff0b264022..109403aa19 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/assets.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/assets.cljs @@ -317,7 +317,7 @@ content (filter #(= (get-role %) :content) children)] [:div.asset-section [:div.asset-title {:class (when (not open?) "closed")} - [:span {:on-click (st/emitf (dwl/set-assets-box-open file-id box (not open?)))} + [:span {:on-click #(st/emit! (dwl/set-assets-box-open file-id box (not open?)))} i/arrow-slide title] [:span.num-assets (str "\u00A0(") assets-count ")"] ;; Unicode 00A0 is non-breaking space title-buttons] @@ -905,7 +905,7 @@ add-graphic (mf/use-callback (fn [] - (st/emitf (dwl/set-assets-box-open file-id :graphics true)) + #(st/emit! (dwl/set-assets-box-open file-id :graphics true)) (dom/click (mf/ref-val input-ref)))) on-file-selected @@ -1898,7 +1898,7 @@ (count (:colors selected-assets)) (count (:typographies selected-assets))) - toggle-open (st/emitf (dwl/set-assets-box-open (:id file) :library (not open?))) + toggle-open #(st/emit! (dwl/set-assets-box-open (:id file) :library (not open?))) url (rt/resolve router :workspace {:project-id (:project-id file) diff --git a/frontend/src/app/main/ui/workspace/sidebar/history.cljs b/frontend/src/app/main/ui/workspace/sidebar/history.cljs index d3db889a0f..4051115adc 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/history.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/history.cljs @@ -260,7 +260,7 @@ :show-detail @show-detail?) :on-mouse-enter #(reset! hover? true) :on-mouse-leave #(reset! hover? false) - :on-click (st/emitf (dwc/undo-to-index idx-entry))} + :on-click #(st/emit! (dwc/undo-to-index idx-entry))} [:div.history-entry-summary [:div.history-entry-summary-icon (entry->icon entry)] [:div.history-entry-summary-text (entry->message locale entry)] diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/bool.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/bool.cljs index 3b76be0c28..38babff4da 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/bool.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/bool.cljs @@ -83,6 +83,6 @@ [:div.align-button.tooltip.tooltip-bottom {:alt (tr "workspace.shape.menu.flatten") :class (dom/classnames :disabled disabled-flatten) - :on-click (st/emitf (dw/convert-selected-to-path))} + :on-click #(st/emit! (dw/convert-selected-to-path))} i/bool-flatten]]])) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.cljs index 2696889899..fdd9da5369 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/component.cljs @@ -53,27 +53,27 @@ #(swap! local assoc :menu-open false)) do-detach-component - (st/emitf (dwl/detach-component id)) + #(st/emit! (dwl/detach-component id)) do-reset-component - (st/emitf (dwl/reset-component id)) + #(st/emit! (dwl/reset-component id)) do-update-component - (st/emitf (dwl/update-component-sync id library-id)) + #(st/emit! (dwl/update-component-sync id library-id)) do-update-remote-component - (st/emitf (modal/show - {:type :confirm - :message "" - :title (tr "modals.update-remote-component.message") - :hint (tr "modals.update-remote-component.hint") - :cancel-label (tr "modals.update-remote-component.cancel") - :accept-label (tr "modals.update-remote-component.accept") - :accept-style :primary - :on-accept do-update-component})) + #(st/emit! (modal/show + {:type :confirm + :message "" + :title (tr "modals.update-remote-component.message") + :hint (tr "modals.update-remote-component.hint") + :cancel-label (tr "modals.update-remote-component.cancel") + :accept-label (tr "modals.update-remote-component.accept") + :accept-style :primary + :on-accept do-update-component})) - do-show-component (st/emitf (dw/go-to-component component-id)) - do-navigate-component-file (st/emitf (dwl/nav-to-component-file library-id))] + do-show-component #(st/emit! (dw/go-to-component component-id)) + do-navigate-component-file #(st/emit! (dwl/nav-to-component-file library-id))] (when show? [:div.element-set [:div.element-set-title diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/interactions.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/interactions.cljs index a37c968fbb..e8ba4e9b9a 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/interactions.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/interactions.cljs @@ -137,7 +137,7 @@ nil)) [:div.flow-element - [:div.flow-button {:on-click (st/emitf (dw/select-shape (:starting-frame flow)))} + [:div.flow-button {:on-click #(st/emit! (dw/select-shape (:starting-frame flow)))} i/play] (if @editing? [:input.element-name @@ -148,9 +148,9 @@ :auto-focus true :default-value (:name flow "")}] [:span.element-label.flow-name - {:on-double-click (st/emitf (dwi/start-rename-flow (:id flow)))} + {:on-double-click #(st/emit! (dwi/start-rename-flow (:id flow)))} (:name flow)]) - [:div.add-page {:on-click (st/emitf (dwi/remove-flow (:id flow)))} + [:div.add-page {:on-click #(st/emit! (dwi/remove-flow (:id flow)))} i/minus]])) (mf/defc page-flows @@ -172,7 +172,7 @@ (if (nil? flow) [:div.flow-element [:span.element-label (tr "workspace.options.flows.add-flow-start")] - [:div.add-page {:on-click (st/emitf (dwi/add-flow-selected-frame))} + [:div.add-page {:on-click #(st/emit! (dwi/add-flow-selected-frame))} i/plus]] [:& flow-item {:flow flow :key (str (:id flow))}])]))) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs index 9471d34bc7..ee70c8d506 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/typography.cljs @@ -552,9 +552,11 @@ [:span (:text-transform typography)]] [:div.row-flex - [:a.go-to-lib-button {:on-click (st/emitf (rt/nav-new-window* {:rname :workspace - :path-params {:project-id (:project-id file) :file-id (:id file)} - :query-params {:page-id (get-in file [:data :pages 0])}}))} + [:a.go-to-lib-button + {:on-click #(st/emit! (rt/nav-new-window* {:rname :workspace + :path-params {:project-id (:project-id file) + :file-id (:id file)} + :query-params {:page-id (get-in file [:data :pages 0])}}))} (tr "workspace.assets.typography.go-to-edit")]]] [:* diff --git a/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs b/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs index e5ed8cfc21..918addeaa6 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs @@ -50,11 +50,11 @@ on-delete (mf/use-callback (mf/deps id) - (st/emitf (modal/show - {:type :confirm - :title (tr "modals.delete-page.title") - :message (tr "modals.delete-page.body") - :on-accept delete-fn}))) + #(st/emit! (modal/show + {:type :confirm + :title (tr "modals.delete-page.title") + :message (tr "modals.delete-page.body") + :on-accept delete-fn}))) on-double-click (mf/use-callback diff --git a/frontend/src/app/main/ui/workspace/viewport/comments.cljs b/frontend/src/app/main/ui/workspace/viewport/comments.cljs index d1a4a75b1a..da82aeaf99 100644 --- a/frontend/src/app/main/ui/workspace/viewport/comments.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/comments.cljs @@ -36,7 +36,7 @@ on-draft-cancel (mf/use-callback - (st/emitf :interrupt)) + #(st/emit! :interrupt)) on-draft-submit (mf/use-callback diff --git a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs index 9f628336d4..bff9296bd6 100644 --- a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs @@ -285,4 +285,4 @@ (fn [] (when (or drawing-path? path-editing?) (st/emit! (dsc/push-shortcuts ::path psc/shortcuts)) - (st/emitf (dsc/pop-shortcuts ::path)))))) + #(st/emit! (dsc/pop-shortcuts ::path)))))) diff --git a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs index 75cbaa64d0..09e247c40f 100644 --- a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs @@ -109,8 +109,8 @@ on-double-click (mf/use-callback (mf/deps (:id frame)) - (st/emitf (dw/go-to-layout :layers) - (dw/start-rename-shape (:id frame)))) + #(st/emit! (dw/go-to-layout :layers) + (dw/start-rename-shape (:id frame)))) on-context-menu (mf/use-callback @@ -209,7 +209,7 @@ on-double-click (mf/use-callback (mf/deps (:id frame)) - (st/emitf (dwi/start-rename-flow (:id flow)))) + #(st/emit! (dwi/start-rename-flow (:id flow)))) on-pointer-enter (mf/use-callback