git ssb

16+

Dominic / patchbay



Tree: 728c0ce9d46f93e3a253ac9117807be3cd9e4d96

Files: 728c0ce9d46f93e3a253ac9117807be3cd9e4d96 / app / sync / addPage.js

542 bytesRaw
1const nest = require('depnest')
2
3exports.gives = nest({ 'app.sync.addPage': true })
4
5exports.needs = nest({
6 'app.html.tabs': 'first',
7 'app.html.page': 'first'
8})
9
10exports.create = function (api) {
11 return nest({
12 'app.sync': { addPage }
13 })
14
15 // TODO : make it so error catching doesn't need this, move it into goTo
16 function addPage (link, change, split) {
17 const tabs = api.app.html.tabs()
18
19 const page = api.app.html.page(link)
20 if (!page) return
21
22 page.id = page.id || link
23 tabs.add(page, change, split)
24 }
25}
26
27

Built with git-ssb-web