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

Commit 5824494

Browse files
Merge pull request #1209 from jedahan/toggle-settings-shortcut
Toggle settings with CommandOrCtrl+.
2 parents d3e6146 + b1273e7 commit 5824494

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/main-window.js

Lines changed: 6 additions & 0 deletions
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) => {
@@ -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) => {

0 commit comments

Comments
 (0)