Files: 728c0ce9d46f93e3a253ac9117807be3cd9e4d96 / app / sync / goTo.js
446 bytesRaw
1 | const nest = require('depnest') |
2 | |
3 | exports.gives = nest({ 'app.sync.goTo': true }) |
4 | |
5 | exports.needs = nest({ |
6 | 'app.html.tabs': 'first', |
7 | 'app.sync.addPage': 'first' |
8 | }) |
9 | |
10 | exports.create = function (api) { |
11 | return nest('app.sync.goTo', function goTo (path, change) { |
12 | const tabs = api.app.html.tabs() |
13 | |
14 | if (tabs.has(path)) { |
15 | tabs.select(path) |
16 | return true |
17 | } |
18 | |
19 | api.app.sync.addPage(path, true, false) |
20 | return change |
21 | }) |
22 | } |
23 | |
24 |
Built with git-ssb-web