Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
fix handling of upload progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
benanhalt committed Apr 12, 2019
1 parent aa89416 commit a7398cb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/UploadFile.elm
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,15 @@ update uploadType index flags msg state =
, Cmd.none
)

UploadComplete 200 _ ->
UploadComplete 202 _ ->
( Finished uploadAs, Cmd.none )

_ ->
UploadComplete _ _ ->
( UploadingFailed { info | status = status }, Cmd.none )

_ ->
( UploadingFile { info | status = status }, Cmd.none )

_ ->
( state, Cmd.none )
else
Expand Down Expand Up @@ -323,7 +326,7 @@ view mapMdlMsg mapMsg index text mdl state =
[ Html.text <| "Failed uploading " ++ uploadAs ++ "." ]

UploadingFailed { localFileName, uploadAs, status } ->
[ Html.p [] [ Html.text <| "Uploading of " ++ uploadAs ++ "finished but resulted in failure." ]
[ Html.p [] [ Html.text <| "Uploading of " ++ uploadAs ++ " finished but resulted in failure." ]
, Button.render mapMdlMsg
(2 :: index)
mdl
Expand Down

0 comments on commit a7398cb

Please sign in to comment.