diff --git a/tabby-core/src/hotkeys.ts b/tabby-core/src/hotkeys.ts index c14ac666..d4465a36 100644 --- a/tabby-core/src/hotkeys.ts +++ b/tabby-core/src/hotkeys.ts @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core' import { TranslateService } from '@ngx-translate/core' import { ProfilesService } from './services/profiles.service' import { HotkeyDescription, HotkeyProvider } from './api/hotkeyProvider' -import { PartialProfile, Profile } from './api' /** @hidden */ @Injectable() @@ -268,7 +267,7 @@ export class AppHotkeyProvider extends HotkeyProvider { return [ ...this.hotkeys, ...profiles.map(profile => ({ - id: `profile.${AppHotkeyProvider.getProfileHotkeyName(profile)}`, + id: `profile.${ProfilesService.getProfileHotkeyName(profile)}`, name: this.translate.instant('New tab: {profile}', { profile: profile.name }), })), ...this.profilesService.getProviders().map(provider => ({ @@ -278,7 +277,4 @@ export class AppHotkeyProvider extends HotkeyProvider { ] } - static getProfileHotkeyName (profile: PartialProfile): string { - return (profile.id ?? profile.name).replace(/\./g, '-') - } } diff --git a/tabby-core/src/index.ts b/tabby-core/src/index.ts index 6cf14a24..fc08aea4 100644 --- a/tabby-core/src/index.ts +++ b/tabby-core/src/index.ts @@ -177,7 +177,7 @@ export default class AppModule { // eslint-disable-line @typescript-eslint/no-ex if (hotkey.startsWith('profile.')) { const id = hotkey.substring(hotkey.indexOf('.') + 1) const profiles = await profilesService.getProfiles() - const profile = profiles.find(x => AppHotkeyProvider.getProfileHotkeyName(x) === id) + const profile = profiles.find(x => ProfilesService.getProfileHotkeyName(x) === id) if (profile) { profilesService.openNewTabForProfile(profile) }