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: 7ac72dc89c53
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: 29f5f02a16c7
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 18, 2020

  1. 1

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    29f5f02 View commit details
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/Main.elm
15 changes: 11 additions & 4 deletions src/Main.elm
Original file line number Diff line number Diff line change
@@ -160,7 +160,14 @@ changeRouteTo :
-> ( Model, Cmd Msg )
changeRouteTo currentModel url =
let
attempteQuery (( newModel, cmd ) as pair) =
attempteQuery ( newModel, cmd ) =
let
-- We intentially throw away Cmd
-- because we don't want to perform any effects
-- in this cases where route itself doesn't change
noEffects =
( newModel, Cmd.none )
in
case ( currentModel.route, newModel.route ) of
( Route.Packages arg1, Route.Packages arg2 ) ->
if
@@ -173,7 +180,7 @@ changeRouteTo currentModel url =
submitQuery newModel ( newModel, cmd )

else
pair
noEffects

( Route.Options arg1, Route.Options arg2 ) ->
if
@@ -186,14 +193,14 @@ changeRouteTo currentModel url =
submitQuery newModel ( newModel, cmd )

else
pair
noEffects

( a, b ) ->
if a /= b then
submitQuery newModel ( newModel, cmd )

else
pair
noEffects
in
case Route.fromUrl url of
Nothing ->