Skip to content

Commit 17f153e

Browse files
committed
revert abort error filtering
1 parent 71de461 commit 17f153e

File tree

3 files changed

+9
-25
lines changed

3 files changed

+9
-25
lines changed

src/renderer/document/events.cljs

+5-12
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
[renderer.document.handlers :as h]
1616
[renderer.element.handlers :as element.h]
1717
[renderer.history.handlers :as history.h]
18-
[renderer.notification.events :as notification.e]
18+
[renderer.notification.events :as-alias notification.e]
1919
[renderer.notification.handlers :as notification.h]
2020
[renderer.notification.views :as notification.v]
2121
[renderer.snap.handlers :as snap.h]
@@ -182,20 +182,13 @@
182182
:formatter #(mapv edn/read-string %)}}
183183
{::app.fx/file-open {:options file-picker-options
184184
:on-success [::file-read]
185-
:on-error [::file-error]}})))
185+
:on-error [::notification.e/exception]}})))
186186

187187
(rf/reg-event-fx
188188
::file-read
189189
(fn [_ [_ file]]
190190
{::fx/read file}))
191191

192-
(rf/reg-event-fx
193-
::file-error
194-
(fn [{:keys [db]} [_ ^js/Error error]]
195-
(cond-> db
196-
(not= (.-name error) "AbortError")
197-
(notification.h/add (notification.v/exception error)))))
198-
199192
(rf/reg-event-fx
200193
::open-directory
201194
(fn [_ [_ path]]
@@ -239,7 +232,7 @@
239232
:formatter (fn [file] {:id (:id document)
240233
:title (.-name file)})
241234
:on-success [::saved]
242-
:on-error [::file-error]}}))))
235+
:on-error [::notification.e/exception]}}))))
243236

244237
(rf/reg-event-fx
245238
::download
@@ -263,7 +256,7 @@
263256
:formatter (fn [file] {:id id
264257
:title (.-name file)})
265258
:on-success [::close-saved]
266-
:on-error [::file-error]}}))))
259+
:on-error [::notification.e/exception]}}))))
267260

268261
(rf/reg-event-fx
269262
::save-as
@@ -280,7 +273,7 @@
280273
:formatter (fn [file] {:id (:id document)
281274
:title (.-name file)})
282275
:on-success [::saved]
283-
:on-error [::file-error]}}))))
276+
:on-error [::notification.e/exception]}}))))
284277

285278
(rf/reg-event-db
286279
::saved

src/renderer/tool/impl/element/image.cljs

+2-10
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
(:require
44
[re-frame.core :as rf]
55
[renderer.app.effects :as-alias app.fx]
6-
[renderer.notification.handlers :as notification.h]
7-
[renderer.notification.views :as notification.v]
6+
[renderer.notification.events :as-alias notification.e]
87
[renderer.tool.handlers :as tool.h]
98
[renderer.tool.hierarchy :as hierarchy]
109
[renderer.utils.drop :as drop]))
@@ -23,7 +22,7 @@
2322
"image/jpeg" [".jpeg" ".jpg"]
2423
"image/bmp" [".fmp"]}}]}
2524
:on-success [::success]
26-
:on-error [::error]}]))
25+
:on-error [::notification.e/exception]}]))
2726

2827
(rf/reg-event-fx
2928
::success
@@ -32,13 +31,6 @@
3231
::add-image [file (or (:point (:nearest-neighbor db))
3332
(:adjusted-pointer-pos db))]}))
3433

35-
(rf/reg-event-db
36-
::error
37-
(fn [db [_ error]]
38-
(cond-> db
39-
(not= (.-name error) "AbortError")
40-
(notification.h/add (notification.v/exception error)))))
41-
4234
(rf/reg-fx
4335
::add-image
4436
(fn [[file position]]

src/renderer/tool/impl/misc/dropper.cljs

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,5 @@
4545
(rf/reg-event-db
4646
::error
4747
(fn [db [_ error]]
48-
(cond-> (h/activate db :transform)
49-
(not= (.-name error) "AbortError")
50-
(notification.h/add (notification.v/exception error)))))
48+
(-> (h/activate db :transform)
49+
(notification.h/add (notification.v/exception error)))))

0 commit comments

Comments
 (0)