diff --git a/frontend/src/app/main/data/dashboard.cljs b/frontend/src/app/main/data/dashboard.cljs index 0511e335d..b75fddfc9 100644 --- a/frontend/src/app/main/data/dashboard.cljs +++ b/frontend/src/app/main/data/dashboard.cljs @@ -63,7 +63,7 @@ ptk/WatchEvent (watch [_ state stream] - (let [stoper-s (rx/filter (ptk/type? ::finalize) stream) + (let [stopper (rx/filter (ptk/type? ::finalize) stream) profile-id (:profile-id state)] (->> (rx/merge @@ -92,7 +92,7 @@ (rx/filter #(= id (:id %))) (rx/map du/set-current-team))) - (rx/take-until stoper-s)))))) + (rx/take-until stopper)))))) (defn finalize [params] diff --git a/frontend/src/app/main/data/events.cljs b/frontend/src/app/main/data/events.cljs index 9fc8bcea5..441ce25c6 100644 --- a/frontend/src/app/main/data/events.cljs +++ b/frontend/src/app/main/data/events.cljs @@ -234,7 +234,7 @@ ptk/EffectEvent (effect [_ _ stream] (let [session (atom nil) - stoper (rx/filter (ptk/type? ::initialize) stream) + stopper (rx/filter (ptk/type? ::initialize) stream) buffer (atom #queue []) profile (->> (rx/from-atom storage {:emit-current-value? true}) (rx/map :profile) @@ -259,7 +259,7 @@ (rx/tap (fn [_] (l/debug :hint "events chunk persisted" :total (count chunk)))) (rx/map (constantly chunk)))))) - (rx/take-until stoper) + (rx/take-until stopper) (rx/subs! (fn [chunk] (swap! buffer remove-from-buffer (count chunk))) (fn [cause] @@ -290,7 +290,7 @@ (swap! buffer append-to-buffer event))) (rx/switch-map #(rx/timer (inst-ms session-timeout))) - (rx/take-until stoper) + (rx/take-until stopper) (rx/subs! (fn [_] (l/debug :hint "session reinitialized") (reset! session nil)) diff --git a/frontend/src/app/main/data/exports.cljs b/frontend/src/app/main/data/exports.cljs index 23eb50956..9894691a2 100644 --- a/frontend/src/app/main/data/exports.cljs +++ b/frontend/src/app/main/data/exports.cljs @@ -209,7 +209,7 @@ (rx/filter #(= @resource-id (:resource-id %))) (rx/share)) - stoper + stopper (rx/filter #(or (= "ended" (:status %)) (= "error" (:status %))) progress-stream)] @@ -228,12 +228,12 @@ (initialize-export-status exports cmd resource)))) ;; We proceed to update the export state with incoming - ;; progress updates. We delay the stoper for give some time + ;; progress updates. We delay the stopper for give some time ;; to update the status with ended or errored status before ;; close the stream. (->> progress-stream (rx/map update-export-status) - (rx/take-until (rx/delay 500 stoper)) + (rx/take-until (rx/delay 500 stopper)) (rx/finalize (fn [] (swap! st/ongoing-tasks disj :export)))) @@ -246,7 +246,7 @@ (rx/take 1) (rx/delay default-timeout) (rx/map #(clear-export-state @resource-id)) - (rx/take-until (rx/delay 6000 stoper)))))))) + (rx/take-until (rx/delay 6000 stopper)))))))) (defn retry-last-export [] diff --git a/frontend/src/app/main/data/messages.cljs b/frontend/src/app/main/data/messages.cljs index 6a31ca363..024fec415 100644 --- a/frontend/src/app/main/data/messages.cljs +++ b/frontend/src/app/main/data/messages.cljs @@ -61,16 +61,16 @@ ptk/WatchEvent (watch [_ _ stream] (rx/merge - (let [stoper (rx/filter (ptk/type? ::hide) stream)] + (let [stopper (rx/filter (ptk/type? ::hide) stream)] (->> stream (rx/filter (ptk/type? :app.util.router/navigate)) (rx/map (constantly hide)) - (rx/take-until stoper))) + (rx/take-until stopper))) (when (:timeout data) - (let [stoper (rx/filter (ptk/type? ::show) stream)] + (let [stopper (rx/filter (ptk/type? ::show) stream)] (->> (rx/of hide) (rx/delay (:timeout data)) - (rx/take-until stoper)))))))) + (rx/take-until stopper)))))))) (def hide (ptk/reify ::hide @@ -80,10 +80,10 @@ ptk/WatchEvent (watch [_ _ stream] - (let [stoper (rx/filter (ptk/type? ::show) stream)] + (let [stopper (rx/filter (ptk/type? ::show) stream)] (->> (rx/of #(dissoc % :message)) (rx/delay default-animation-timeout) - (rx/take-until stoper)))))) + (rx/take-until stopper)))))) (defn hide-tag [tag] diff --git a/frontend/src/app/main/data/websocket.cljs b/frontend/src/app/main/data/websocket.cljs index b7ec7c2db..2ed31de56 100644 --- a/frontend/src/app/main/data/websocket.cljs +++ b/frontend/src/app/main/data/websocket.cljs @@ -51,9 +51,9 @@ (vreset! ws-conn ws) - (let [stoper (rx/merge - (rx/filter (ptk/type? ::finalize) stream) - (rx/filter (ptk/type? ::initialize) stream))] + (let [stopper (rx/merge + (rx/filter (ptk/type? ::finalize) stream) + (rx/filter (ptk/type? ::initialize) stream))] (->> (rx/merge (rx/of #(assoc % :ws-conn ws)) @@ -64,7 +64,7 @@ (->> (ws/get-rcv-stream ws) (rx/filter ws/opened-event?) (rx/map (fn [_] (ptk/data-event ::opened {}))))) - (rx/take-until stoper))))))) + (rx/take-until stopper))))))) ;; --- Finalize Websocket diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 190a48c15..90251479f 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -41,7 +41,6 @@ [app.main.data.workspace.changes :as dch] [app.main.data.workspace.collapse :as dwco] [app.main.data.workspace.drawing :as dwd] - [app.main.data.workspace.drawing.common :as dwdc] [app.main.data.workspace.edition :as dwe] [app.main.data.workspace.fix-bool-contents :as fbc] [app.main.data.workspace.fix-broken-shapes :as fbs] @@ -153,7 +152,7 @@ (watch [_ _ stream] (let [team-id (:id team) file-id (:id file) - stoper-s (rx/filter (ptk/type? ::bundle-fetched) stream)] + stopper (rx/filter (ptk/type? ::bundle-fetched) stream)] (->> (rx/concat ;; Initialize notifications @@ -204,7 +203,7 @@ (rx/of (with-meta (workspace-initialized) {:file-id file-id}))) - (rx/take-until stoper-s)))))) + (rx/take-until stopper)))))) (defn- libraries-fetched [libraries] @@ -2138,7 +2137,6 @@ (watch [_ _ _] (if read-only? (rx/of :interrupt - (dwdc/clear-drawing) (remove-layout-flag :colorpalette) (remove-layout-flag :textpalette)) (rx/empty))))) diff --git a/frontend/src/app/main/data/workspace/colors.cljs b/frontend/src/app/main/data/workspace/colors.cljs index 7c31ef43b..3a8bf6e13 100644 --- a/frontend/src/app/main/data/workspace/colors.cljs +++ b/frontend/src/app/main/data/workspace/colors.cljs @@ -526,9 +526,9 @@ (ptk/reify ::initialize-colorpicker ptk/WatchEvent (watch [_ _ stream] - (let [stoper (rx/merge - (rx/filter (ptk/type? ::finalize-colorpicker) stream) - (rx/filter (ptk/type? ::initialize-colorpicker) stream))] + (let [stopper (rx/merge + (rx/filter (ptk/type? ::finalize-colorpicker) stream) + (rx/filter (ptk/type? ::initialize-colorpicker) stream))] (->> (rx/merge (->> stream @@ -537,7 +537,7 @@ (rx/filter (ptk/type? ::update-colorpicker-color) stream) (rx/filter (ptk/type? ::activate-colorpicker-gradient) stream)) (rx/map (constantly (colorpicker-onchange-runner on-change))) - (rx/take-until stoper)))) + (rx/take-until stopper)))) ptk/UpdateEvent (update [_ state] diff --git a/frontend/src/app/main/data/workspace/comments.cljs b/frontend/src/app/main/data/workspace/comments.cljs index 800647dad..3d1457d56 100644 --- a/frontend/src/app/main/data/workspace/comments.cljs +++ b/frontend/src/app/main/data/workspace/comments.cljs @@ -34,7 +34,7 @@ (ptk/reify ::initialize-comments ptk/WatchEvent (watch [_ _ stream] - (let [stoper (rx/filter #(= ::finalize %) stream)] + (let [stopper (rx/filter #(= ::finalize %) stream)] (rx/merge (rx/of (dcm/retrieve-comment-threads file-id)) (->> stream @@ -45,11 +45,11 @@ (rx/filter (fn [[_ space]] (not space))) (rx/map first) (rx/map handle-comment-layer-click) - (rx/take-until stoper)) + (rx/take-until stopper)) (->> stream (rx/filter dwco/interrupt?) (rx/map handle-interrupt) - (rx/take-until stoper))))))) + (rx/take-until stopper))))))) (defn- handle-interrupt [] diff --git a/frontend/src/app/main/data/workspace/drawing/box.cljs b/frontend/src/app/main/data/workspace/drawing/box.cljs index 6eab07265..76a6c3ce8 100644 --- a/frontend/src/app/main/data/workspace/drawing/box.cljs +++ b/frontend/src/app/main/data/workspace/drawing/box.cljs @@ -78,12 +78,12 @@ (ptk/reify ::handle-drawing ptk/WatchEvent (watch [_ state stream] - (let [stoper (rx/merge - (->> stream - (rx/filter mse/mouse-event?) - (rx/filter mse/mouse-up-event?)) - (->> stream - (rx/filter #(= % :interrupt)))) + (let [stopper (rx/merge + (->> stream + (rx/filter mse/mouse-event?) + (rx/filter mse/mouse-up-event?)) + (->> stream + (rx/filter #(= % :interrupt)))) layout (get state :workspace-layout) zoom (dm/get-in state [:workspace-local :zoom] 1) @@ -131,7 +131,7 @@ (rx/filter #(> (gpt/distance % initial) (/ 2 zoom))) ;; Take until before the snap calculation otherwise we could cancel the snap in the worker ;; and its a problem for fast moving drawing - (rx/take-until stoper) + (rx/take-until stopper) (rx/with-latest-from ms/mouse-position-shift ms/mouse-position-mod) (rx/switch-map (fn [[point :as current]] diff --git a/frontend/src/app/main/data/workspace/drawing/curve.cljs b/frontend/src/app/main/data/workspace/drawing/curve.cljs index c223df896..8a2194962 100644 --- a/frontend/src/app/main/data/workspace/drawing/curve.cljs +++ b/frontend/src/app/main/data/workspace/drawing/curve.cljs @@ -28,7 +28,7 @@ (def simplify-tolerance 0.3) -(defn stoper-event? +(defn stopper-event? [{:keys [type] :as event}] (and (mse/mouse-event? event) (= type :up))) @@ -104,7 +104,7 @@ (ptk/reify ::handle-drawing ptk/WatchEvent (watch [_ _ stream] - (let [stoper (rx/filter stoper-event? stream) + (let [stopper (rx/filter stopper-event? stream) mouse (rx/sample 10 ms/mouse-position) shape (cts/setup-shape {:type :path :initialized? true @@ -115,7 +115,7 @@ (rx/of #(update % :workspace-drawing assoc :object shape)) (->> mouse (rx/map insert-point) - (rx/take-until stoper)) + (rx/take-until stopper)) (rx/of (setup-frame) (finish-drawing) diff --git a/frontend/src/app/main/data/workspace/notifications.cljs b/frontend/src/app/main/data/workspace/notifications.cljs index 8df110920..4bb3a9772 100644 --- a/frontend/src/app/main/data/workspace/notifications.cljs +++ b/frontend/src/app/main/data/workspace/notifications.cljs @@ -38,7 +38,7 @@ (ptk/reify ::initialize ptk/WatchEvent (watch [_ state stream] - (let [stoper (rx/filter (ptk/type? ::finalize) stream) + (let [stopper (rx/filter (ptk/type? ::finalize) stream) profile-id (:profile-id state) initmsg [{:type :subscribe-file @@ -87,7 +87,7 @@ (rx/pipe (rxs/throttle 100)) (rx/map #(handle-pointer-send file-id (:pt %))))) - (rx/take-until stoper))] + (rx/take-until stopper))] (rx/concat stream (rx/of (dws/send endmsg))))))) diff --git a/frontend/src/app/main/data/workspace/path/selection.cljs b/frontend/src/app/main/data/workspace/path/selection.cljs index c60c13f4a..028a6ec3b 100644 --- a/frontend/src/app/main/data/workspace/path/selection.cljs +++ b/frontend/src/app/main/data/workspace/path/selection.cljs @@ -120,12 +120,12 @@ ptk/WatchEvent (watch [_ state stream] (let [zoom (get-in state [:workspace-local :zoom] 1) - stoper (rx/merge - (->> stream - (rx/filter mse/mouse-event?) - (rx/filter mse/mouse-up-event?)) - (->> stream - (rx/filter dwc/interrupt?))) + stopper (rx/merge + (->> stream + (rx/filter mse/mouse-event?) + (rx/filter mse/mouse-up-event?)) + (->> stream + (rx/filter dwc/interrupt?))) from-p @ms/mouse-position] (rx/concat @@ -133,7 +133,7 @@ (rx/map #(grc/points->rect [from-p %])) (rx/filter (partial valid-rect? zoom)) (rx/map update-area-selection) - (rx/take-until stoper)) + (rx/take-until stopper)) (rx/of (select-node-area shift?) (clear-area-selection)))))))) diff --git a/frontend/src/app/main/data/workspace/path/streams.cljs b/frontend/src/app/main/data/workspace/path/streams.cljs index 0bc1ad208..9f55e92a0 100644 --- a/frontend/src/app/main/data/workspace/path/streams.cljs +++ b/frontend/src/app/main/data/workspace/path/streams.cljs @@ -52,19 +52,19 @@ start (-> @ms/mouse-position to-pixel-snap) - stoper (rx/merge - (->> st/stream - (rx/filter mse/mouse-event?) - (rx/filter mse/mouse-up-event?)) - (->> st/stream - (rx/filter finish-edition?))) + stopper (rx/merge + (->> st/stream + (rx/filter mse/mouse-event?) + (rx/filter mse/mouse-up-event?)) + (->> st/stream + (rx/filter finish-edition?))) position-stream (->> ms/mouse-position (rx/map to-pixel-snap) (rx/filter (dragging? start zoom)) (rx/take 1) - (rx/take-until stoper))] + (rx/take-until stopper))] (rx/merge (->> position-stream diff --git a/frontend/src/app/main/data/workspace/persistence.cljs b/frontend/src/app/main/data/workspace/persistence.cljs index bcfc60b58..c0032c6c8 100644 --- a/frontend/src/app/main/data/workspace/persistence.cljs +++ b/frontend/src/app/main/data/workspace/persistence.cljs @@ -37,7 +37,7 @@ ptk/WatchEvent (watch [_ _ stream] (log/debug :hint "initialize persistence") - (let [stoper (rx/filter (ptk/type? ::initialize-persistence) stream) + (let [stopper (rx/filter (ptk/type? ::initialize-persistence) stream) commits (l/atom []) saving? (l/atom false) @@ -53,7 +53,7 @@ on-dirty (fn [] - ;; Enable reload stoper + ;; Enable reload stopper (swap! st/ongoing-tasks conj :workspace-change) (st/emit! (update-persistence-status {:status :pending}))) @@ -64,7 +64,7 @@ on-saved (fn [] - ;; Disable reload stoper + ;; Disable reload stopper (swap! st/ongoing-tasks disj :workspace-change) (st/emit! (update-persistence-status {:status :saved})) (reset! saving? false))] @@ -82,7 +82,7 @@ (assoc :file-id file-id)))) (rx/observe-on :async) (rx/tap #(swap! commits conj %)) - (rx/take-until (rx/delay 100 stoper)) + (rx/take-until (rx/delay 100 stopper)) (rx/finalize (fn [] (log/debug :hint "finalize persistence: changes watcher")))) @@ -115,7 +115,7 @@ (rx/tap on-saved) (rx/ignore))) (rx/empty)))) - (rx/take-until (rx/delay 100 stoper)) + (rx/take-until (rx/delay 100 stopper)) (rx/finalize (fn [] (log/debug :hint "finalize persistence: save loop")))) @@ -126,7 +126,7 @@ (rx/filter library-file?) (rx/filter (complement #(empty? (:changes %)))) (rx/map persist-synchronous-changes) - (rx/take-until (rx/delay 100 stoper)) + (rx/take-until (rx/delay 100 stopper)) (rx/finalize (fn [] (log/debug :hint "finalize persistence: synchronous save loop"))))))))) diff --git a/frontend/src/app/main/data/workspace/selection.cljs b/frontend/src/app/main/data/workspace/selection.cljs index 033c96000..89904f836 100644 --- a/frontend/src/app/main/data/workspace/selection.cljs +++ b/frontend/src/app/main/data/workspace/selection.cljs @@ -64,12 +64,12 @@ ptk/WatchEvent (watch [_ state stream] (let [zoom (dm/get-in state [:workspace-local :zoom] 1) - stoper (rx/merge - (->> stream - (rx/filter mse/mouse-event?) - (rx/filter mse/mouse-up-event?)) - (->> stream - (rx/filter interrupt?))) + stopper (rx/merge + (->> stream + (rx/filter mse/mouse-event?) + (rx/filter mse/mouse-up-event?)) + (->> stream + (rx/filter interrupt?))) init-position @ms/mouse-position @@ -99,7 +99,7 @@ (rx/scan calculate-selrect init-selrect) (rx/filter #(or (> (dm/get-prop % :width) (/ 10 zoom)) (> (dm/get-prop % :height) (/ 10 zoom)))) - (rx/take-until stoper))] + (rx/take-until stopper))] (rx/concat (if preserve? @@ -667,9 +667,9 @@ ptk/WatchEvent (watch [_ _ stream] - (let [stoper (rx/filter (ptk/type? ::memorize-duplicated) stream)] + (let [stopper (rx/filter (ptk/type? ::memorize-duplicated) stream)] (->> (rx/timer 10000) ;; This time may be adjusted after some user testing. - (rx/take-until stoper) + (rx/take-until stopper) (rx/map clear-memorize-duplicated)))))) (defn calc-duplicate-delta diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index fb81c4d74..be9635715 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -370,9 +370,9 @@ ptk/WatchEvent (watch [_ _ stream] - (let [stoper (->> stream - (rx/filter mse/mouse-event?) - (rx/filter mse/mouse-up-event?)) + (let [stopper (->> stream + (rx/filter mse/mouse-event?) + (rx/filter mse/mouse-up-event?)) group (gsh/shapes->rect shapes) group-center (grc/rect->center group) @@ -399,7 +399,7 @@ (fn [[pos mod? shift?]] (let [delta-angle (calculate-angle pos mod? shift?)] (dwm/set-rotation-modifiers delta-angle shapes group-center)))) - (rx/take-until stoper)) + (rx/take-until stopper)) (rx/of (dwm/apply-modifiers) (finish-transform))))))) diff --git a/frontend/src/app/util/router.cljs b/frontend/src/app/util/router.cljs index be54cb855..50a9bb0fd 100644 --- a/frontend/src/app/util/router.cljs +++ b/frontend/src/app/util/router.cljs @@ -149,7 +149,7 @@ ptk/EffectEvent (effect [_ state stream] - (let [stoper (rx/filter (ptk/type? ::initialize-history) stream) + (let [stopper (rx/filter (ptk/type? ::initialize-history) stream) history (:history state) router (:router state)] (ts/schedule #(on-change router (.getToken ^js history))) @@ -158,5 +158,5 @@ (fn [] (bhistory/disable! history) (e/unlistenByKey key))))) - (rx/take-until stoper) + (rx/take-until stopper) (rx/subs! #(on-change router %)))))))