Files: 8fde330d9640244a94c068b1f62791019b5b6338 / 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