mirror of
https://github.com/penpot/penpot.git
synced 2026-06-09 08:52:05 +00:00
🐛 Fix get-comment-threads called with empty params due to race condition (#9988)
Prevent navigate-to-comment-id from making an RPC call with nil
file-id when current-file-id has been cleared by finalize-workspace
during rapid workspace navigation. The deferred stream observer
(rx/observe-on :async) could fire after the workspace state was
already cleaned up, causing {:file-id nil} to become {} after
query-string nil-filtering in map->query-string.
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
e2545915b8
commit
a57833f3cd
@ -274,7 +274,8 @@
|
||||
(ptk/reify ::navigate-to-comment-id
|
||||
ptk/WatchEvent
|
||||
(watch [_ state _]
|
||||
(let [file-id (:current-file-id state)]
|
||||
(if-let [file-id (:current-file-id state)]
|
||||
(->> (rp/cmd! :get-comment-threads {:file-id file-id})
|
||||
(rx/map #(d/seek (fn [{:keys [id]}] (= thread-id id)) %))
|
||||
(rx/map navigate-to-comment))))))
|
||||
(rx/map navigate-to-comment))
|
||||
(rx/empty)))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user