fix: copy share link to clipboard command display issue (#7411)

fix AF-1027
This commit is contained in:
pengx17
2024-07-02 15:28:30 +00:00
parent b8b30e79e5
commit ef7ba273ab
3 changed files with 9 additions and 6 deletions

View File

@@ -160,17 +160,17 @@ export class CommandsQuickSearchSession
return result.map<QuickSearchItem<'commands', AffineCommand>>(
({ item, matches, score = 1 }) => {
const nomalizedRange = ([start, end]: [number, number]) =>
const normalizedRange = ([start, end]: [number, number]) =>
[
start,
end + 1 /* in fuse, the `end` is different from the `substring` */,
] as [number, number];
const titleMatches = matches
?.filter(match => match.key === 'label.title')
.flatMap(match => match.indices.map(nomalizedRange));
.flatMap(match => match.indices.map(normalizedRange));
const subTitleMatches = matches
?.filter(match => match.key === 'label.subTitle')
.flatMap(match => match.indices.map(nomalizedRange));
.flatMap(match => match.indices.map(normalizedRange));
return {
id: 'command:' + item.id,