🐛 Add missing retry cancelation when thumbnail is discarded

This commit is contained in:
Andrey Antukh 2023-11-24 17:03:10 +01:00 committed by Aitor
parent 0528c26b5e
commit 5486ab43a8
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))))))