Loading image

This commit is contained in:
Thomas Forgione 2020-10-04 23:07:27 +02:00
parent 72b0e8775c
commit af6afdc1dc
2 changed files with 9 additions and 2 deletions

View File

@ -27,6 +27,7 @@ type alias Model =
type Page
= Home
| Loading
| Playlist Twitch.PlaylistWithVideos
| Video Twitch.PlaylistWithVideos Twitch.Video
@ -165,14 +166,14 @@ update msg model =
)
( ( _, _ ), ( Just name, Nothing ) ) ->
( m.page
( Loading
, Task.perform
PlaylistReceived
(Twitch.fetchPlaylistWithVideos name)
)
( ( _, _ ), ( Just name, Just video ) ) ->
( m.page
( Loading
, Task.perform
(PlaylistReceivedVideo video time)
(Twitch.fetchPlaylistWithVideos name)

View File

@ -55,6 +55,9 @@ title model =
Core.Home ->
Consts.url
Core.Loading ->
Consts.url
Core.Playlist p ->
Consts.url ++ " - " ++ p.name
@ -68,6 +71,9 @@ viewContent model =
Core.Home ->
playlistsView model.device model.playlists
Core.Loading ->
Element.el [ Element.padding 10, Element.centerX ] spinner
Core.Playlist playlist ->
videoMiniaturesView model.device model.zone playlist