summaryrefslogtreecommitdiff
path: root/Hero/Client.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-06-12 09:37:37 -0700
committerBen Sima <ben@bsima.me>2020-06-12 09:37:37 -0700
commitde70e6455ae735a9d24e00677a07dbaf2b6cf355 (patch)
tree28452ff84e012604be1effffdb2ed323d192605a /Hero/Client.hs
parent37062e1ca6c479b7cf773931aa0e797ebcfafe8b (diff)
Reorganize a bunch of code
Nothing should be functioning differntly, just made it easier to work on.
Diffstat (limited to 'Hero/Client.hs')
-rw-r--r--Hero/Client.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/Hero/Client.hs b/Hero/Client.hs
index 4189fd8..2b222bd 100644
--- a/Hero/Client.hs
+++ b/Hero/Client.hs
@@ -31,8 +31,8 @@ import Hero.App
User (..),
audioId,
chooseExperienceLink,
- comicPlayerFullLink,
- comicPlayerSpreadLink,
+ comicReaderFullLink,
+ comicReaderSpreadLink,
comicVideoLink,
handlers,
initModel,
@@ -100,27 +100,27 @@ move DumpModel model = model <# do
move (SelectExperience comic) model = model {cpState = ChooseExperience (comicId comic) 1}
<# do pure $ ChangeURI $ chooseExperienceLink (comicId comic) 1
move (StartReading comic) model = model {cpState = Reading Spread (comicId comic) 1}
- <# do pure $ ChangeURI $ comicPlayerSpreadLink (comicId comic) 1
+ <# do pure $ ChangeURI $ comicReaderSpreadLink (comicId comic) 1
move (StartWatching comic) model = model {cpState = Watching (comicId comic)}
<# do pure $ ChangeURI $ comicVideoLink (comicId comic) 1
move NextPage model = case cpState model of
Reading Spread id pg ->
model {cpState = Reading Spread id (pg + 2)} <# do
- pure $ ChangeURI $ comicPlayerSpreadLink id (pg + 2)
+ pure $ ChangeURI $ comicReaderSpreadLink id (pg + 2)
Reading Full id pg ->
model {cpState = Reading Full id (pg + 1)} <# do
- pure $ ChangeURI $ comicPlayerFullLink id (pg + 1)
+ pure $ ChangeURI $ comicReaderFullLink id (pg + 1)
Cover id ->
model {cpState = Reading Spread id 1} <# do
- pure $ ChangeURI $ comicPlayerSpreadLink id 1
+ pure $ ChangeURI $ comicReaderSpreadLink id 1
_ -> noEff model
move PrevPage model = case cpState model of
Reading Spread id pg ->
model {cpState = Reading Spread id (pg -2)} <# do
- pure $ ChangeURI $ comicPlayerSpreadLink id (pg -2)
+ pure $ ChangeURI $ comicReaderSpreadLink id (pg -2)
Reading Full id pg ->
model {cpState = Reading Full id (pg -1)} <# do
- pure $ ChangeURI $ comicPlayerFullLink id (pg -1)
+ pure $ ChangeURI $ comicReaderFullLink id (pg -1)
Cover _ -> noEff model
_ -> noEff model
move (ToggleZoom c pg) m = m {cpState = newState} <# pure act
@@ -128,8 +128,8 @@ move (ToggleZoom c pg) m = m {cpState = newState} <# pure act
goto lnk = ChangeURI $ lnk (comicId c) pg
reading v = Reading v (comicId c) pg
(newState, act) = case cpState m of
- Reading Full _ _ -> (reading Spread, goto comicPlayerSpreadLink)
- Reading Spread _ _ -> (reading Full, goto comicPlayerFullLink)
+ Reading Full _ _ -> (reading Spread, goto comicReaderSpreadLink)
+ Reading Spread _ _ -> (reading Full, goto comicReaderFullLink)
x -> (x, NoOp)
move (ToggleInLibrary c) model = model {user = newUser} <# pure NoOp
where