client: fix insert command

pull/177/head
fantasticit 2022-08-23 10:21:32 +08:00
parent 068aa17110
commit 2d5c756c0b
1 changed files with 4 additions and 1 deletions

View File

@ -17,7 +17,10 @@ export const Insert: React.FC<{ editor: Editor }> = ({ editor }) => {
const [visible, toggleVisible] = useToggle(false);
const renderedCommands = useMemo(
() => (recentUsed.length ? [{ title: '最近使用' }, ...recentUsed, ...COMMANDS] : COMMANDS),
() =>
(recentUsed.length ? [{ title: '最近使用' }, ...recentUsed, ...COMMANDS] : COMMANDS).filter((command) => {
return command.label === '表格' || command.label === '布局' ? 'custom' in command : true;
}),
[recentUsed]
);