Skip to content

Commit dc11d72

Browse files
committed
ack PR comment
1 parent 84e1f86 commit dc11d72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/sim/app/workspace/[workspaceId]/providers/global-commands-provider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ export function useRegisterGlobalCommands(commands: GlobalCommand[] | (() => Glo
148148
}
149149

150150
const commandsRef = useRef<GlobalCommand[]>([])
151-
commandsRef.current = typeof commands === 'function' ? commands() : commands
151+
const list = typeof commands === 'function' ? commands() : commands
152+
commandsRef.current = list
152153

153154
useEffect(() => {
154-
const list = typeof commands === 'function' ? commands() : commands
155-
const wrappedCommands = list.map((cmd) => ({
155+
const wrappedCommands = commandsRef.current.map((cmd) => ({
156156
...cmd,
157157
handler: (event: KeyboardEvent) => {
158158
const currentCmd = commandsRef.current.find((c) => c.id === cmd.id)

0 commit comments

Comments
 (0)