Merge pull request #3856 from penpot/niwinz-develop-bugfixes-1

🐛 Add missing retry cancelation when thumbnail is discarded
This commit is contained in:
Aitor Moreno 2023-11-28 17:48:08 +01:00 committed by GitHub
commit 6ed35ffdc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View file

@ -6,6 +6,7 @@
(ns app.util.timers
(:require
[app.common.data :as d]
[beicon.core :as rx]
[promesa.core :as p]))
@ -14,7 +15,12 @@
(schedule 0 func))
([ms func]
(let [sem (js/setTimeout #(func) ms)]
(reify rx/IDisposable
(reify
d/ICloseable
(close! [_]
(js/clearTimeout sem))
rx/IDisposable
(-dispose [_]
(js/clearTimeout sem))))))