File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/webgal/src/UI/Menu/SaveAndLoad/Save Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1- import { CSSProperties , FC } from 'react' ;
1+ import { CSSProperties , FC , useEffect } from 'react' ;
22import styles from '../SaveAndLoad.module.scss' ;
33import { saveGame } from '@/Core/controller/storage/saveGame' ;
44import { setStorage } from '@/Core/controller/storage/storageController' ;
@@ -9,6 +9,7 @@ import { showGlogalDialog } from '@/UI/GlobalDialog/GlobalDialog';
99import useTrans from '@/hooks/useTrans' ;
1010import { useTranslation } from 'react-i18next' ;
1111import useSoundEffect from '@/hooks/useSoundEffect' ;
12+ import { getSavesFromStorage } from '@/Core/controller/storage/savesController' ;
1213
1314export 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 ++ ;
You can’t perform that action at this time.
0 commit comments