mirror of
https://github.com/penpot/penpot.git
synced 2025-03-16 01:31:22 -05:00
Complete http stream after a response es emitted.
This commit is contained in:
parent
ea9a096fa9
commit
658636463e
1 changed files with 5 additions and 4 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Reference in a new issue