mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-23 21:09:52 +00:00
fixed hotkey race condition
This commit is contained in:
parent
79de7ec015
commit
434bacf185
@ -72,7 +72,11 @@ export class HotkeysService {
|
||||
@Inject(HotkeyProvider) private hotkeyProviders: HotkeyProvider[],
|
||||
hostApp: HostAppService,
|
||||
) {
|
||||
this.config.ready$.toPromise().then(async () => {
|
||||
const hotkeys = await this.getHotkeyDescriptions()
|
||||
this.hotkeyDescriptions = hotkeys
|
||||
const events = ['keydown', 'keyup']
|
||||
|
||||
events.forEach(eventType => {
|
||||
document.addEventListener(eventType, (nativeEvent: KeyboardEvent) => {
|
||||
this._keyEvent.next(nativeEvent)
|
||||
@ -83,9 +87,6 @@ export class HotkeysService {
|
||||
}
|
||||
})
|
||||
})
|
||||
this.config.ready$.toPromise().then(async () => {
|
||||
const hotkeys = await this.getHotkeyDescriptions()
|
||||
this.hotkeyDescriptions = hotkeys
|
||||
})
|
||||
|
||||
// deprecated
|
||||
|
Loading…
x
Reference in New Issue
Block a user