@@ -65,6 +65,7 @@ const GameCard = ({
65
65
const [ gameAvailable , setGameAvailable ] = useState (
66
66
gameInfoFromProps . is_installed
67
67
)
68
+ const [ isLaunching , setIsLaunching ] = useState ( false )
68
69
69
70
const { t } = useTranslation ( 'gamepage' )
70
71
const { t : t2 } = useTranslation ( )
@@ -93,6 +94,18 @@ const GameCard = ({
93
94
thirdPartyManagedApp
94
95
} = gameInfo
95
96
97
+ // if the game supports cloud saves, check the config
98
+ const [ autoSyncSaves , setAutoSyncSaves ] = useState ( hasCloudSave )
99
+ useEffect ( ( ) => {
100
+ const checkGameConfig = async ( ) => {
101
+ const settings = await window . api . requestGameSettings ( appName )
102
+ setAutoSyncSaves ( settings . autoSyncSaves )
103
+ }
104
+ if ( hasCloudSave ) {
105
+ checkGameConfig ( )
106
+ }
107
+ } , [ appName ] )
108
+
96
109
const [ progress , previousProgress ] = hasProgress ( appName )
97
110
98
111
const { status, folder } =
@@ -112,6 +125,7 @@ const GameCard = ({
112
125
} , [ appName , status , gameInfo ] )
113
126
114
127
useEffect ( ( ) => {
128
+ setIsLaunching ( false )
115
129
const updateGameInfo = async ( ) => {
116
130
const newInfo = await getGameInfo ( appName , runner )
117
131
if ( newInfo ) {
@@ -262,6 +276,7 @@ const GameCard = ({
262
276
className = { gameAvailable ? 'playIcon' : 'cancelIcon' }
263
277
onClick = { async ( ) => handlePlay ( runner ) }
264
278
title = { `${ t ( 'label.playing.start' ) } (${ title } )` }
279
+ disabled = { isLaunching }
265
280
>
266
281
< PlayIcon />
267
282
</ SvgButton >
@@ -537,12 +552,13 @@ const GameCard = ({
537
552
}
538
553
539
554
if ( isInstalled ) {
555
+ setIsLaunching ( true )
540
556
return launch ( {
541
557
appName,
542
558
t,
543
559
runner,
544
560
hasUpdate,
545
- syncCloud : gameInfo ?. cloud_save_enabled ,
561
+ syncCloud : autoSyncSaves ,
546
562
showDialogModal
547
563
} )
548
564
}
0 commit comments