mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Prioritize shortcut matching by level
This commit is contained in:
@@ -36,6 +36,11 @@ export const useGlobalShortcutsStore = create<ShortcutsStore>((set, get) => ({
|
||||
};
|
||||
}),
|
||||
|
||||
getAllShortcuts: () => Object.values(get().shortcutGroups).flat(),
|
||||
/**
|
||||
* Returns all shortcuts, priritized by level (descending).
|
||||
*/
|
||||
getAllShortcuts: () => Object.values(get().shortcutGroups)
|
||||
.flat()
|
||||
.sort((a, b) => (b.level ?? 0) - (a.level ?? 0)),
|
||||
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user