Skip to content

Commit 25c6541

Browse files
fix: save page load from storage
1 parent 7f0fc40 commit 25c6541

File tree

1 file changed

+7
-1
lines changed
  • packages/webgal/src/UI/Menu/SaveAndLoad/Save

1 file changed

+7
-1
lines changed

packages/webgal/src/UI/Menu/SaveAndLoad/Save/Save.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSProperties, FC } from 'react';
1+
import { CSSProperties, FC, useEffect } from 'react';
22
import styles from '../SaveAndLoad.module.scss';
33
import { saveGame } from '@/Core/controller/storage/saveGame';
44
import { setStorage } from '@/Core/controller/storage/storageController';
@@ -9,6 +9,7 @@ import { showGlogalDialog } from '@/UI/GlobalDialog/GlobalDialog';
99
import useTrans from '@/hooks/useTrans';
1010
import { useTranslation } from 'react-i18next';
1111
import useSoundEffect from '@/hooks/useSoundEffect';
12+
import { getSavesFromStorage } from '@/Core/controller/storage/savesController';
1213

1314
export const Save: FC = () => {
1415
const { playSePageChange, playSeEnter, playSeDialogOpen } = useSoundEffect();
@@ -44,6 +45,11 @@ export const Save: FC = () => {
4445
// 现在尝试设置10个存档每页
4546
const start = (userDataState.optionData.slPage - 1) * 10 + 1;
4647
const end = start + 9;
48+
49+
useEffect(() => {
50+
getSavesFromStorage(start, end);
51+
}, [start, end]);
52+
4753
let animationIndex = 0;
4854
for (let i = start; i <= end; i++) {
4955
animationIndex++;

0 commit comments

Comments
 (0)