Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit d7ac846

Browse files
author
Jonathan Dahan
committed
Toggle settings with CommandOrCtrl+.
1 parent 3fe3f72 commit d7ac846

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/main-window.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ module.exports = function (config) {
5858
const includeParticipating = api.settings.obs.get('patchwork.includeParticipating', false)
5959
const autoDeleteBlocked = api.settings.obs.get('patchwork.autoDeleteBlocked', false)
6060

61+
electron.remote.globalShortcut.register('CmdOrCtrl+.', () => {
62+
toggleView('/settings')
63+
})
64+
6165
// prompt to setup profile on first use
6266
onceTrue(api.sbot.obs.connection, (ssb) => {
6367
ssb.latestSequence(api.keys.sync.id(), (err, key) => {
@@ -218,7 +222,7 @@ module.exports = function (config) {
218222
[i18n('Tags'), `/tags/all/${encodeURIComponent(id)}`],
219223
[i18n('Extended Network'), '/all'],
220224
{ separator: true },
221-
[i18n('Settings'), '/settings']
225+
[i18n('Settings') + ' Ctrl+.', '/settings']
222226
])
223227
]),
224228
h('span.appTitle', [
@@ -245,6 +249,8 @@ module.exports = function (config) {
245249
views.html
246250
])
247251

252+
const toggleView = view => { if (views.currentView() === view) { views.goBack() } else {navigate(view)} }
253+
248254
const previewElement = api.app.linkPreview(container, 500)
249255

250256
catchLinks(container, (href, external, anchor) => {
@@ -255,6 +261,7 @@ module.exports = function (config) {
255261
api.app.navigate(href, anchor)
256262
}
257263
})
264+
258265
return [container, previewElement]
259266

260267
// scoped

0 commit comments

Comments
 (0)