mirror of
https://github.com/eugeny/tabby
synced 2025-12-11 18:25:57 +00:00
fixed profile order in the selector dialog - fixes #5537
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { firstBy } from 'thenby'
|
||||
import { Component, Input, HostListener, ViewChildren, QueryList, ElementRef } from '@angular/core' // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { SelectorOption } from '../api/selector'
|
||||
@@ -52,8 +53,11 @@ export class SelectorModalComponent<T> {
|
||||
onFilterChange (): void {
|
||||
const f = this.filter.trim().toLowerCase()
|
||||
if (!f) {
|
||||
this.filteredOptions = this.options.slice()
|
||||
.sort((a, b) => a.group?.localeCompare(b.group ?? '') ?? 0)
|
||||
this.filteredOptions = this.options.slice().sort(
|
||||
firstBy<SelectorOption<T>, number>(x => x.weight ?? 0)
|
||||
.thenBy<SelectorOption<T>, string>(x => x.group ?? '')
|
||||
.thenBy<SelectorOption<T>, string>(x => x.name)
|
||||
)
|
||||
.filter(x => !x.freeInputPattern)
|
||||
} else {
|
||||
const terms = f.split(' ')
|
||||
|
||||
Reference in New Issue
Block a user