git ssb

16+

Dominic / patchbay



Tree: 084946f795412a5d314bb4c3f4848d887219c041

Files: 084946f795412a5d314bb4c3f4848d887219c041 / app / sync / initialise / userActionListeners.js

763 bytesRaw
1const nest = require('depnest')
2const electron = require('electron')
3
4exports.gives = nest('app.sync.initialise')
5
6exports.needs = nest({
7 'app.async.catchLinkClick': 'first',
8 'app.sync.catchKeyboardShortcut': 'first',
9 'app.html.tabs': 'first',
10})
11
12
13exports.create = function (api) {
14 return nest('app.sync.initialise', userActionListeners)
15
16 function userActionListeners (App) {
17 const tabs = api.app.html.tabs()
18
19 api.app.sync.catchKeyboardShortcut(window)
20 api.app.async.catchLinkClick(App)
21
22 electron.ipcRenderer.on('nextTab', () => {
23 tabs.nextTab()
24 })
25
26 electron.ipcRenderer.on('previousTab', () => {
27 tabs.previousTab()
28 })
29
30 electron.ipcRenderer.on('closeTab', () => {
31 tabs.closeCurrentTab()
32 })
33
34 }
35}
36
37

Built with git-ssb-web