diff options
author | Yorhel <git@yorhel.nl> | 2020-05-28 19:11:24 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2020-05-28 19:11:24 +0200 |
commit | 980b704417133dbbdec6f2571620dc3dcab2bb40 (patch) | |
tree | 87b0cfe0429f9a0a027c4124aba6032e9ba557e8 /elm | |
parent | e36bfde55478f4ae5d83ee73845a348a92386bca (diff) |
Staff::Edit: Make sure not to remove referenced aliases on revert
Diffstat (limited to 'elm')
-rw-r--r-- | elm/StaffEdit.elm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/elm/StaffEdit.elm b/elm/StaffEdit.elm index 0347319b..134a409b 100644 --- a/elm/StaffEdit.elm +++ b/elm/StaffEdit.elm @@ -126,7 +126,7 @@ update msg model = AliasName i s -> (validate { model | alias = modidx i (\e -> { e | name = s }) model.alias }, Cmd.none) AliasOrig i s -> (validate { model | alias = modidx i (\e -> { e | original = s }) model.alias }, Cmd.none) AliasMain n _ -> ({ model | aid = n }, Cmd.none) - AliasAdd -> ({ model | alias = model.alias ++ [{ aid = newAid model, name = "", original = "", inuse = False }] }, Cmd.none) + AliasAdd -> ({ model | alias = model.alias ++ [{ aid = newAid model, name = "", original = "", inuse = False, wantdel = False }] }, Cmd.none) Submit -> ({ model | state = Api.Loading }, GSE.send (encode model) Submitted) Submitted (GApi.Redirect s) -> (model, load s) @@ -150,6 +150,7 @@ view model = ] , td [ class "tc_add" ] [ if model.aid == e.aid then b [ class "grayedout" ] [ text " primary" ] + else if e.wantdel then b [ class "standout" ] [ text " still referenced" ] else if e.inuse then b [ class "grayedout" ] [ text " referenced" ] else inputButton "remove" (AliasDel n) [] ] |