0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 00:58:26 -05:00

Discard wrong queued change if back fails.

This commit is contained in:
Andrey Antukh 2020-11-30 15:33:20 +01:00 committed by Hirunatan
parent 39fb611160
commit 6f64053dd5

View file

@ -125,9 +125,13 @@
(rx/map #(shapes-changes-persisted file-id %))))))
on-error
(fn [error]
(rx/of (update-persistence-status {:status :error
:reason (:type error)})))]
(fn [{:keys [type status] :as error}]
(if (and (= :server-error type)
(= 502 status))
(rx/of (update-persistence-status {:status :error :reason type}))
(rx/of update-persistence-queue
(update-persistence-status {:status :error :reason type}))))]
(when (= file-id (:id file))
(->> (rp/mutation :update-file params)