git ssb

16+

Dominic / patchbay



Tree: b7d7f86afc99c01161ac2e00a2decf8ecb85246e

Files: b7d7f86afc99c01161ac2e00a2decf8ecb85246e / app / sync / addPage.js

553 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': {
13 addPage
14 }
15 })
16
17 // TODO : make it so error catching doesn't need this, move it into goTo
18 function addPage (link, change, split) {
19 const tabs = api.app.html.tabs()
20
21 const page = api.app.html.page(link)
22 if (!page) return
23
24 page.id = page.id || link
25 tabs.add(page, change, split)
26 }
27}
28
29
30

Built with git-ssb-web