summaryrefslogtreecommitdiff
path: root/elm/DocEdit.elm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-12-10 10:32:37 +0100
committerYorhel <git@yorhel.nl>2019-12-10 10:32:39 +0100
commit5075f0ef4573fa95252c1a91b62239cc9b6347bb (patch)
treefcc6be6d5cad66dc1af217a4f6b3fe733df60945 /elm/DocEdit.elm
parentfa7b9e6a14a1597516738a75b6dfb9d326be7d48 (diff)
Elm: Add Redirect response + fix redirect to last post on reply
Fixes https://vndb.org/t2520/14#334 - I originally had some trouble to do this because `load` doesn't actually reload the page if you're just changing the hash. The `reload` following it handles that now. The Redirect response is just cleanup, there's several places that could benefit form it.
Diffstat (limited to 'elm/DocEdit.elm')
-rw-r--r--elm/DocEdit.elm2
1 files changed, 1 insertions, 1 deletions
diff --git a/elm/DocEdit.elm b/elm/DocEdit.elm
index 3fad1f8f..e4282213 100644
--- a/elm/DocEdit.elm
+++ b/elm/DocEdit.elm
@@ -73,7 +73,7 @@ update msg model =
let body = GD.encode (encode model)
in ({ model | state = Api.Loading }, Api.post "/d/edit.json" body Submitted)
- Submitted (GApi.Changed id rev) -> (model, load <| "/d" ++ String.fromInt id ++ "." ++ String.fromInt rev)
+ Submitted (GApi.Redirect s) -> (model, load s)
Submitted r -> ({ model | state = Api.Error r }, Cmd.none)