mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
🐛 Properly dispose rx subscription on grid thumbnail component
This commit is contained in:
@@ -89,6 +89,7 @@
|
||||
|
||||
(mf/with-effect [file-id revn visible? thumbnail-id]
|
||||
(when (and visible? (not thumbnail-id))
|
||||
(let [subscription
|
||||
(->> (ask-for-thumbnail file-id revn)
|
||||
(rx/subs! (fn [thumbnail-id]
|
||||
(st/emit! (dd/set-file-thumbnail file-id thumbnail-id)))
|
||||
@@ -96,7 +97,8 @@
|
||||
(log/error :hint "unable to render thumbnail"
|
||||
:file-if file-id
|
||||
:revn revn
|
||||
:message (ex-message cause)))))))
|
||||
:message (ex-message cause)))))]
|
||||
(partial rx/dispose! subscription))))
|
||||
|
||||
[:div {:class (stl/css :grid-item-th)
|
||||
:style {:background-color bg-color}
|
||||
|
||||
Reference in New Issue
Block a user