aboutsummaryrefslogtreecommitdiff
path: root/src/view
diff options
context:
space:
mode:
authorJoris2021-05-18 12:56:36 +0200
committerJoris2021-05-18 12:56:36 +0200
commitcde24cbf3fbc418af3c98d82e47dcd5df71e5b26 (patch)
tree994d532d2d7196ca2dda6f39cdfba36f83d455ce /src/view
parentd1ce8774ec3291374c222c8f64c085e3a99f6147 (diff)
Improve route type
Diffstat (limited to 'src/view')
-rw-r--r--src/view/form.ts2
-rw-r--r--src/view/timer.ts4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/view/form.ts b/src/view/form.ts
index 0b04cfb..b0d5827 100644
--- a/src/view/form.ts
+++ b/src/view/form.ts
@@ -32,7 +32,7 @@ export function view(config: Config.Config, showPage: (route: Router.Route) => v
{ className: 'g-Form'
, onsubmit: (e: Event) => {
e.preventDefault()
- const timerRoute = { kind: Router.Kind.Timer, config }
+ const timerRoute: Router.Route = { name: 'timer', config }
history.pushState({}, '', Router.toString(timerRoute))
showPage(timerRoute)
}},
diff --git a/src/view/timer.ts b/src/view/timer.ts
index 061f5d4..07b5db3 100644
--- a/src/view/timer.ts
+++ b/src/view/timer.ts
@@ -18,7 +18,7 @@ export function clearInterval() {
export function view(config: Config.Config, showPage: (route: Router.Route) => void) {
- const formUrl = `${Router.toString({ kind: Router.Kind.Form, config })}`
+ const formUrl = `${Router.toString({ name: 'form', config })}`
const duration = Config.getDuration(config)
// State
@@ -42,7 +42,7 @@ export function view(config: Config.Config, showPage: (route: Router.Route) => v
}
const quit = () => {
- const formRoute = { kind: Router.Kind.Form, config }
+ const formRoute: Router.Route = { name: 'form', config }
history.pushState({}, '', Router.toString(formRoute))
clearInterval()
showPage(formRoute)