Remove unused viewmode

This commit is contained in:
Eike Kettner 2020-09-13 17:23:13 +02:00
parent 7c245ab0da
commit 913bfb611c
3 changed files with 3 additions and 19 deletions

View File

@ -2,7 +2,6 @@ module Page.Home.Data exposing
( Model ( Model
, Msg(..) , Msg(..)
, SearchType(..) , SearchType(..)
, ViewMode(..)
, defaultSearchType , defaultSearchType
, doSearchCmd , doSearchCmd
, init , init
@ -30,7 +29,6 @@ type alias Model =
{ searchMenuModel : Comp.SearchMenu.Model { searchMenuModel : Comp.SearchMenu.Model
, itemListModel : Comp.ItemCardList.Model , itemListModel : Comp.ItemCardList.Model
, searchInProgress : Bool , searchInProgress : Bool
, viewMode : ViewMode
, menuCollapsed : Bool , menuCollapsed : Bool
, searchOffset : Int , searchOffset : Int
, moreAvailable : Bool , moreAvailable : Bool
@ -57,7 +55,6 @@ init flags =
{ searchMenuModel = Comp.SearchMenu.init { searchMenuModel = Comp.SearchMenu.init
, itemListModel = Comp.ItemCardList.init , itemListModel = Comp.ItemCardList.init
, searchInProgress = False , searchInProgress = False
, viewMode = Listing
, menuCollapsed = True , menuCollapsed = True
, searchOffset = 0 , searchOffset = 0
, moreAvailable = True , moreAvailable = True
@ -119,11 +116,6 @@ searchTypeString st =
"Contents Only" "Contents Only"
type ViewMode
= Listing
| Detail
itemNav : String -> Model -> { prev : Maybe String, next : Maybe String } itemNav : String -> Model -> { prev : Maybe String, next : Maybe String }
itemNav id model = itemNav id model =
let let

View File

@ -105,7 +105,6 @@ update key flags settings msg model =
{ model { model
| searchInProgress = False | searchInProgress = False
, searchOffset = noff , searchOffset = noff
, viewMode = Listing
, moreAvailable = list.groups /= [] , moreAvailable = list.groups /= []
} }
in in
@ -121,7 +120,6 @@ update key flags settings msg model =
| searchInProgress = False | searchInProgress = False
, moreInProgress = False , moreInProgress = False
, searchOffset = noff , searchOffset = noff
, viewMode = Listing
, moreAvailable = list.groups /= [] , moreAvailable = list.groups /= []
} }
in in
@ -244,7 +242,6 @@ doSearch flags settings model =
withSub withSub
( { model_ ( { model_
| searchInProgress = cmd /= Cmd.none | searchInProgress = cmd /= Cmd.none
, viewMode = Listing
, searchOffset = 0 , searchOffset = 0
, throttle = newThrottle , throttle = newThrottle
} }
@ -258,7 +255,7 @@ doSearchMore flags settings model =
cmd = cmd =
doSearchCmd flags settings model.searchOffset model doSearchCmd flags settings model.searchOffset model
in in
( { model | moreInProgress = True, viewMode = Listing } ( { model | moreInProgress = True }
, cmd , cmd
) )

View File

@ -81,13 +81,8 @@ view flags settings model =
] ]
] ]
[ viewSearchBar flags model [ viewSearchBar flags model
, case model.viewMode of , Html.map ItemCardListMsg
Listing -> (Comp.ItemCardList.view settings model.itemListModel)
Html.map ItemCardListMsg
(Comp.ItemCardList.view settings model.itemListModel)
Detail ->
div [] []
] ]
, div , div
[ classList [ classList