mirror of
https://github.com/penpot/penpot.git
synced 2026-03-12 05:16:23 +00:00
Complete http stream after a response es emitted.
This commit is contained in:
@@ -74,10 +74,11 @@
|
||||
(letfn [(on-complete [event]
|
||||
(if (or (= (.getLastErrorCode xhr) ErrorCode.HTTP_ERROR)
|
||||
(.isSuccess xhr))
|
||||
(sink {:status (.getStatus xhr)
|
||||
:body (.getResponse xhr)
|
||||
:headers (normalize-headers
|
||||
(.getResponseHeaders xhr))})
|
||||
(sink (rx/end
|
||||
{:status (.getStatus xhr)
|
||||
:body (.getResponse xhr)
|
||||
:headers (normalize-headers
|
||||
(.getResponseHeaders xhr))}))
|
||||
(sink (let [type (-> (.getLastErrorCode xhr)
|
||||
(translate-error-code))
|
||||
message (.getLastError xhr)]
|
||||
|
||||
Reference in New Issue
Block a user