parent
fe04d9b14e
commit
1407641e45
|
@ -118,30 +118,30 @@ type Sort
|
||||||
init : Route.SearchArgs -> Maybe (Model a) -> ( Model a, Cmd (Msg a) )
|
init : Route.SearchArgs -> Maybe (Model a) -> ( Model a, Cmd (Msg a) )
|
||||||
init args model =
|
init args model =
|
||||||
let
|
let
|
||||||
defaultChannel =
|
channel =
|
||||||
model
|
model
|
||||||
|> Maybe.map (\x -> x.channel)
|
|> Maybe.map (\x -> x.channel)
|
||||||
|> Maybe.withDefault "unstable"
|
|> Maybe.withDefault defaultChannel
|
||||||
|
|
||||||
defaultFrom =
|
from =
|
||||||
model
|
model
|
||||||
|> Maybe.map (\x -> x.from)
|
|> Maybe.map (\x -> x.from)
|
||||||
|> Maybe.withDefault 0
|
|> Maybe.withDefault 0
|
||||||
|
|
||||||
defaultSize =
|
size =
|
||||||
model
|
model
|
||||||
|> Maybe.map (\x -> x.size)
|
|> Maybe.map (\x -> x.size)
|
||||||
|> Maybe.withDefault 30
|
|> Maybe.withDefault 30
|
||||||
in
|
in
|
||||||
( { channel = Maybe.withDefault defaultChannel args.channel
|
( { channel = Maybe.withDefault channel args.channel
|
||||||
, query = Maybe.andThen Route.SearchQuery.searchQueryToString args.query
|
, query = Maybe.andThen Route.SearchQuery.searchQueryToString args.query
|
||||||
, result =
|
, result =
|
||||||
model
|
model
|
||||||
|> Maybe.map (\x -> x.result)
|
|> Maybe.map (\x -> x.result)
|
||||||
|> Maybe.withDefault RemoteData.NotAsked
|
|> Maybe.withDefault RemoteData.NotAsked
|
||||||
, show = args.show
|
, show = args.show
|
||||||
, from = Maybe.withDefault defaultFrom args.from
|
, from = Maybe.withDefault from args.from
|
||||||
, size = Maybe.withDefault defaultSize args.size
|
, size = Maybe.withDefault size args.size
|
||||||
, sort =
|
, sort =
|
||||||
args.sort
|
args.sort
|
||||||
|> Maybe.withDefault ""
|
|> Maybe.withDefault ""
|
||||||
|
@ -272,6 +272,11 @@ type alias ChannelDetails =
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
defaultChannel : String
|
||||||
|
defaultChannel =
|
||||||
|
"20.09"
|
||||||
|
|
||||||
|
|
||||||
channelDetails : Channel -> ChannelDetails
|
channelDetails : Channel -> ChannelDetails
|
||||||
channelDetails channel =
|
channelDetails channel =
|
||||||
case channel of
|
case channel of
|
||||||
|
|
Loading…
Reference in a new issue