mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-24 05:07:06 +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) => {
|
const handleLangChange = (lang: string) => {
|
||||||
block.setProperty('lang', lang);
|
block.setProperty('lang', lang);
|
||||||
setExtensions([langs[lang]()]);
|
langs[lang] && setExtensions([langs[lang]()]);
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLangChange(langType ? langType : DEFAULT_LANG);
|
handleLangChange(langType ? langType : DEFAULT_LANG);
|
||||||
|
|||||||
Reference in New Issue
Block a user