mirror of
https://github.com/marktext/marktext.git
synced 2025-05-03 04:20:36 +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')) }}
|
key: ${{ runner.os }}-electron-builder-cache-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- 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
|
run: yarn install --check-files --frozen-lockfile
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
|
@ -36,7 +36,7 @@ class Keybindings {
|
|||||||
getAccelerator (id) {
|
getAccelerator (id) {
|
||||||
const name = this.keys.get(id)
|
const name = this.keys.get(id)
|
||||||
if (!name) {
|
if (!name) {
|
||||||
return ''
|
return null
|
||||||
}
|
}
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
@ -146,7 +146,6 @@ class Keybindings {
|
|||||||
|
|
||||||
_loadLocalKeybindings () {
|
_loadLocalKeybindings () {
|
||||||
if (global.MARKTEXT_SAFE_MODE || !isFile2(this.configPath)) {
|
if (global.MARKTEXT_SAFE_MODE || !isFile2(this.configPath)) {
|
||||||
console.log('Ignoring key bindings because safe mode is enabled.')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,13 +85,12 @@ class SettingWindow extends BaseWindow {
|
|||||||
win.loadURL(this._buildUrlString(this.id, env, preferences))
|
win.loadURL(this._buildUrlString(this.id, env, preferences))
|
||||||
win.setSheetOffset(TITLE_BAR_HEIGHT)
|
win.setSheetOffset(TITLE_BAR_HEIGHT)
|
||||||
|
|
||||||
electronLocalshortcut.register(
|
const devToolsAccelerator = keybindings.getAccelerator('view.toggle-dev-tools')
|
||||||
win,
|
if (env.debug && devToolsAccelerator) {
|
||||||
keybindings.getAccelerator('view.toggle-dev-tools'),
|
electronLocalshortcut.register(win, devToolsAccelerator, () => {
|
||||||
() => {
|
|
||||||
win.webContents.toggleDevTools()
|
win.webContents.toggleDevTools()
|
||||||
}
|
})
|
||||||
)
|
}
|
||||||
return win
|
return win
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user