mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 07:06:28 +08:00
fix(code): langs[lang] is not a function
This commit is contained in:
@@ -160,7 +160,7 @@ export const CodeView = ({ block, editor }: CreateCodeView) => {
|
||||
};
|
||||
const handleLangChange = (lang: string) => {
|
||||
block.setProperty('lang', lang);
|
||||
setExtensions([langs[lang]()]);
|
||||
langs[lang] && setExtensions([langs[lang]()]);
|
||||
};
|
||||
useEffect(() => {
|
||||
handleLangChange(langType ? langType : DEFAULT_LANG);
|
||||
|
||||
Reference in New Issue
Block a user