change route works

This commit is contained in:
DieMyst 2020-11-30 21:35:08 +03:00
parent a235ed9cbd
commit b028804ea1
2 changed files with 4 additions and 7 deletions

View File

@ -57,10 +57,10 @@ routeCommand m r =
sendAir (DiscoverPeers.air m.peerId m.relayId) sendAir (DiscoverPeers.air m.peerId m.relayId)
Peer _ -> Peer _ ->
sendAir (DiscoverPeers.air m.peerId m.relayId) Cmd.none
Service string -> Service string ->
sendAir (DiscoverPeers.air m.peerId m.relayId) Cmd.none
Module string -> Module string ->
sendAir (DiscoverPeers.air m.peerId m.relayId) Cmd.none

View File

@ -21,8 +21,6 @@ import Blueprints.Model exposing (Blueprint)
import Browser import Browser
import Browser.Navigation as Nav import Browser.Navigation as Nav
import Dict exposing (Dict) import Dict exposing (Dict)
import Json.Decode exposing (decodeValue, list, string)
import Json.Encode exposing (Value)
import Maybe exposing (withDefault) import Maybe exposing (withDefault)
import Model exposing (Model, PeerData, emptyPeerData) import Model exposing (Model, PeerData, emptyPeerData)
import Msg exposing (..) import Msg exposing (..)
@ -41,14 +39,13 @@ update msg model =
UrlChanged url -> UrlChanged url ->
let let
_ = Debug.log "url changed" url
route = route =
Route.parse url Route.parse url
cmd = cmd =
Route.routeCommand model route Route.routeCommand model route
in in
( { model | url = url }, cmd ) ( { model | url = url, page = route }, cmd )
LinkClicked urlRequest -> LinkClicked urlRequest ->
case urlRequest of case urlRequest of