1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-09-11 04:43:03 +03:00

fixed #8440 - multiple separate "ungrouped" groups

This commit is contained in:
Eugene Pankov 2023-06-04 20:55:44 +02:00
parent 86cff8d98a
commit e813133f12
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
2 changed files with 7 additions and 2 deletions

View File

@ -96,6 +96,8 @@ export class ProfilesService {
const freeInputEquivalent = provider?.intoQuickConnectString(fullProfile) ?? undefined
return {
...profile,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
group: profile.group || '',
freeInputEquivalent,
description: provider?.getDescription(fullProfile),
}

View File

@ -163,10 +163,13 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
const profileGroupCollapsed = JSON.parse(window.localStorage.profileGroupCollapsed ?? '{}')
for (const profile of this.profiles) {
let group = this.profileGroups.find(x => x.name === profile.group)
// Group null, undefined and empty together
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
let group = this.profileGroups.find(x => x.name === (profile.group || ''))
if (!group) {
group = {
name: profile.group,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
name: profile.group || '',
profiles: [],
editable: true,
collapsed: profileGroupCollapsed[profile.group ?? ''] ?? false,