mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 17:19:03 +08:00
Fix invalid fallback accelerator warning (#2892)
This commit is contained in:
parent
3f15e048f5
commit
75591f0958
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@ -135,7 +135,8 @@ jobs:
|
||||
key: ${{ runner.os }}-electron-builder-cache-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
|
||||
|
||||
- name: Install dependencies
|
||||
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
|
||||
# Windows worker fail sometimes because a module cannot be found.
|
||||
# if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
|
||||
run: yarn install --check-files --frozen-lockfile
|
||||
|
||||
- name: Lint
|
||||
|
@ -36,7 +36,7 @@ class Keybindings {
|
||||
getAccelerator (id) {
|
||||
const name = this.keys.get(id)
|
||||
if (!name) {
|
||||
return ''
|
||||
return null
|
||||
}
|
||||
return name
|
||||
}
|
||||
@ -146,7 +146,6 @@ class Keybindings {
|
||||
|
||||
_loadLocalKeybindings () {
|
||||
if (global.MARKTEXT_SAFE_MODE || !isFile2(this.configPath)) {
|
||||
console.log('Ignoring key bindings because safe mode is enabled.')
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -85,13 +85,12 @@ class SettingWindow extends BaseWindow {
|
||||
win.loadURL(this._buildUrlString(this.id, env, preferences))
|
||||
win.setSheetOffset(TITLE_BAR_HEIGHT)
|
||||
|
||||
electronLocalshortcut.register(
|
||||
win,
|
||||
keybindings.getAccelerator('view.toggle-dev-tools'),
|
||||
() => {
|
||||
const devToolsAccelerator = keybindings.getAccelerator('view.toggle-dev-tools')
|
||||
if (env.debug && devToolsAccelerator) {
|
||||
electronLocalshortcut.register(win, devToolsAccelerator, () => {
|
||||
win.webContents.toggleDevTools()
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
return win
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user