mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Use a single place to create values for bool custom fields
This commit is contained in:
@ -24,6 +24,7 @@ import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick, onInput)
|
||||
import Messages.Comp.CustomFieldInput exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.CustomField
|
||||
import Util.Maybe
|
||||
|
||||
|
||||
@ -267,18 +268,11 @@ update1 forSearch msg model =
|
||||
|
||||
( ToggleBool, BoolField b ) ->
|
||||
let
|
||||
notb =
|
||||
not b
|
||||
|
||||
model_ =
|
||||
{ model | fieldModel = BoolField notb }
|
||||
{ model | fieldModel = BoolField (not b) }
|
||||
|
||||
value =
|
||||
if notb then
|
||||
"true"
|
||||
|
||||
else
|
||||
"false"
|
||||
Util.CustomField.boolValue (not b)
|
||||
in
|
||||
UpdateResult model_ Cmd.none (Value value)
|
||||
|
||||
|
Reference in New Issue
Block a user