Skip to content

Commit

Permalink
fixed #8440 - multiple separate "ungrouped" groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Jun 4, 2023
1 parent 86cff8d commit e813133
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tabby-core/src/services/profiles.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e813133

Please sign in to comment.