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

View File

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

View File

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