Commit 5d53dd6aa9aad22cb634152c1035a243557b12f5
if we know it will error if a key is not a message id, check it explicitly
Dominic Tarr committed on 8/9/2017, 9:11:10 PMParent: 9836e9e9dcd5acec7ee3725da3b5e9784a5490bd
Files changed
router/sync/routes.js | changed |
router/sync/routes.js | ||
---|---|---|
@@ -1,7 +1,7 @@ | ||
1 | 1 | const nest = require('depnest') |
2 | 2 | const isEmpty = require('lodash/isEmpty') |
3 | - | |
3 | +const ref = require('ssb-ref') | |
4 | 4 | exports.gives = nest('router.sync.routes') |
5 | 5 | |
6 | 6 | exports.needs = nest({ |
7 | 7 | 'app.page.home': 'first', |
@@ -12,13 +12,14 @@ | ||
12 | 12 | exports.create = (api) => { |
13 | 13 | return nest('router.sync.routes', (sofar = []) => { |
14 | 14 | const pages = api.app.page |
15 | 15 | // route format: [ routeValidator, routeFunction ] |
16 | + console.log('LOCATION', location, isEmpty(location.key)) | |
16 | 17 | const routes = [ |
17 | 18 | [ location => location.page === 'home', pages.home ], |
18 | 19 | [ location => location.type === 'group', pages.group ], |
19 | 20 | [ location => location.page === 'channel', pages.channel ], |
20 | - [ location => !isEmpty(location.key), pages.privatePage ] | |
21 | + [ location => ref.isMsg(location.key), pages.private ] | |
21 | 22 | ] |
22 | 23 | |
23 | 24 | return [...routes, ...sofar] |
24 | 25 | }) |
@@ -31,4 +32,5 @@ | ||
31 | 32 | |
32 | 33 | |
33 | 34 | |
34 | 35 | |
36 | + |
Built with git-ssb-web