aboutsummaryrefslogtreecommitdiff
path: root/src/router.ts
diff options
context:
space:
mode:
authorJoris2021-05-15 12:47:04 +0200
committerJoris2021-05-15 12:47:04 +0200
commitd1ce8774ec3291374c222c8f64c085e3a99f6147 (patch)
tree3ed888c65600cfea0d56494ae35940744eba1d14 /src/router.ts
parent6a9f9a9f3cf547da80df973950489e343143289d (diff)
downloadtabata-d1ce8774ec3291374c222c8f64c085e3a99f6147.tar.gz
tabata-d1ce8774ec3291374c222c8f64c085e3a99f6147.tar.bz2
tabata-d1ce8774ec3291374c222c8f64c085e3a99f6147.zip
Add warm up
Diffstat (limited to 'src/router.ts')
-rw-r--r--src/router.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/router.ts b/src/router.ts
index abbdc65..ff6c724 100644
--- a/src/router.ts
+++ b/src/router.ts
@@ -24,8 +24,9 @@ export function from(location: Location): Route {
if (xs.length === 2) {
const key = xs[0]
const value = parseInt(xs[1])
- if (key == 'prepare') config.prepare = value
- else if (key == 'tabatas') config.tabatas = value
+ if (key == 'warmup') config.warmup = value
+ else if (key == 'tabatas') config.tabatas = value
+ else if (key == 'prepare') config.prepare = value
else if (key == 'cycles') config.cycles = value
else if (key == 'work') config.work = value
else if (key == 'rest') config.rest = value
@@ -41,10 +42,11 @@ export function toString(route: Route): string {
const path = route.kind === Kind.Form ? '/' : '/timer'
let query = ''
if (route.config !== undefined) {
- const { prepare, tabatas, cycles, work, rest } = route.config
+ const { warmup, tabatas, prepare, cycles, work, rest } = route.config
const params = [
- `prepare=${prepare}`,
+ `warmup=${warmup}`,
`tabatas=${tabatas}`,
+ `prepare=${prepare}`,
`cycles=${cycles}`,
`work=${work}`,
`rest=${rest}`,