Skip to content

Commit

Permalink
fix: 修复重复刷新主题切换会默认问题
Browse files Browse the repository at this point in the history
  • Loading branch information
syb01094648 committed Oct 20, 2023
1 parent dd4d507 commit ef87817
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/components/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Check warning on line 20 in src/pages/components/editor.tsx

View workflow job for this annotation

GitHub Actions / lint (16.x)

`ahooks` import should occur before import of `../../components`

Check warning on line 20 in src/pages/components/editor.tsx

View workflow job for this annotation

GitHub Actions / lint (16.x)

`ahooks` import should occur before import of `../../components`

type EditorProps = L7EditorProps;

Expand All @@ -26,7 +27,7 @@ export const Editor: React.FC<EditorProps> = (props) => {
const { theme, mapOptions, setMapOptions, showIndex, locale } = useGlobal();
const styles = useStyle();

useEffect(() => {
useUpdateEffect(() => {
if (theme === 'dark') {
setMapOptions({ ...mapOptions, style: 'dark' });
} else {
Expand Down

0 comments on commit ef87817

Please sign in to comment.