Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixos-search
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fe04d9b14e5d
Choose a base ref
...
head repository: NixOS/nixos-search
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1407641e45fd
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 4, 2020

  1. 1

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    MylesBorins Myles Borins
    Copy the full SHA
    1407641 View commit details
Showing with 12 additions and 7 deletions.
  1. +12 −7 src/Search.elm
19 changes: 12 additions & 7 deletions src/Search.elm
Original file line number Diff line number Diff line change
@@ -118,30 +118,30 @@ type Sort
init : Route.SearchArgs -> Maybe (Model a) -> ( Model a, Cmd (Msg a) )
init args model =
let
defaultChannel =
channel =
model
|> Maybe.map (\x -> x.channel)
|> Maybe.withDefault "unstable"
|> Maybe.withDefault defaultChannel

defaultFrom =
from =
model
|> Maybe.map (\x -> x.from)
|> Maybe.withDefault 0

defaultSize =
size =
model
|> Maybe.map (\x -> x.size)
|> Maybe.withDefault 30
in
( { channel = Maybe.withDefault defaultChannel args.channel
( { channel = Maybe.withDefault channel args.channel
, query = Maybe.andThen Route.SearchQuery.searchQueryToString args.query
, result =
model
|> Maybe.map (\x -> x.result)
|> Maybe.withDefault RemoteData.NotAsked
, show = args.show
, from = Maybe.withDefault defaultFrom args.from
, size = Maybe.withDefault defaultSize args.size
, from = Maybe.withDefault from args.from
, size = Maybe.withDefault size args.size
, sort =
args.sort
|> Maybe.withDefault ""
@@ -272,6 +272,11 @@ type alias ChannelDetails =
}


defaultChannel : String
defaultChannel =
"20.09"


channelDetails : Channel -> ChannelDetails
channelDetails channel =
case channel of