Latest stable is now the default channel (#221)

fixes #220
This commit is contained in:
Pier-Luc Faucher 2020-11-04 06:33:02 -05:00 committed by GitHub
parent fe04d9b14e
commit 1407641e45
Failed to generate hash of commit

View file

@ -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