git ssb

2+

mixmix / ticktack



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 PM
Parent: 9836e9e9dcd5acec7ee3725da3b5e9784a5490bd

Files changed

router/sync/routes.jschanged
router/sync/routes.jsView
@@ -1,7 +1,7 @@
11 const nest = require('depnest')
22 const isEmpty = require('lodash/isEmpty')
3-
3+const ref = require('ssb-ref')
44 exports.gives = nest('router.sync.routes')
55
66 exports.needs = nest({
77 'app.page.home': 'first',
@@ -12,13 +12,14 @@
1212 exports.create = (api) => {
1313 return nest('router.sync.routes', (sofar = []) => {
1414 const pages = api.app.page
1515 // route format: [ routeValidator, routeFunction ]
16+ console.log('LOCATION', location, isEmpty(location.key))
1617 const routes = [
1718 [ location => location.page === 'home', pages.home ],
1819 [ location => location.type === 'group', pages.group ],
1920 [ location => location.page === 'channel', pages.channel ],
20- [ location => !isEmpty(location.key), pages.privatePage ]
21+ [ location => ref.isMsg(location.key), pages.private ]
2122 ]
2223
2324 return [...routes, ...sofar]
2425 })
@@ -31,4 +32,5 @@
3132
3233
3334
3435
36+

Built with git-ssb-web