From ef8781743d13c176b645e35a90a84a6e702b01fb Mon Sep 17 00:00:00 2001 From: syb01094648 Date: Fri, 20 Oct 2023 14:02:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E4=B8=BB=E9=A2=98=E5=88=87=E6=8D=A2=E4=BC=9A?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/components/editor.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/components/editor.tsx b/src/pages/components/editor.tsx index 843e10a..42733a6 100644 --- a/src/pages/components/editor.tsx +++ b/src/pages/components/editor.tsx @@ -17,6 +17,7 @@ import { LangList } from '../../locales'; import { useGlobal } from '../../recoil'; import type { L7EditorProps } from '../../types'; import useStyle from './styles'; +import { useUpdateEffect } from 'ahooks'; type EditorProps = L7EditorProps; @@ -26,7 +27,7 @@ export const Editor: React.FC = (props) => { const { theme, mapOptions, setMapOptions, showIndex, locale } = useGlobal(); const styles = useStyle(); - useEffect(() => { + useUpdateEffect(() => { if (theme === 'dark') { setMapOptions({ ...mapOptions, style: 'dark' }); } else {