pass dispatch to newCommand result (#5258)

This commit is contained in:
James Gatz 2022-10-11 12:30:34 +02:00 committed by GitHub
parent 4817b59d4e
commit 55d6733793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,6 @@ import { selectActiveWorkspace } from '../redux/selectors';
export const useAppCommands = () => {
const dispatch = useDispatch();
const handleCommand = dispatch(newCommand);
const activeWorkspace = useSelector(selectActiveWorkspace);
// Handle Application Commands
@ -18,7 +17,7 @@ export const useAppCommands = () => {
const command = `${parsed.hostname}${parsed.pathname}`;
const args = JSON.parse(JSON.stringify(parsed.query));
args.workspaceId = args.workspaceId || activeWorkspace?._id;
handleCommand(command, args);
newCommand(command, args)(dispatch);
});
}, [activeWorkspace?._id, handleCommand]);
}, [activeWorkspace?._id, dispatch]);
};