feat: adding level generic interface

This commit is contained in:
Chubby Granny Chaser
2025-11-29 02:19:41 +00:00
parent f41128c4c8
commit 140718764d
18 changed files with 36 additions and 24 deletions

View File

@@ -79,7 +79,10 @@ export function GameOptionsModal({
const debounceUpdateLaunchOptions = useRef(
debounce(async (value: string) => {
const gameKey = getGameKey(game.shop, game.objectId);
const gameData = (await levelDBService.get(gameKey, "games")) as Game | null;
const gameData = (await levelDBService.get(
gameKey,
"games"
)) as Game | null;
if (gameData) {
const updated = {
...gameData,
@@ -221,7 +224,10 @@ export function GameOptionsModal({
setLaunchOptions("");
const gameKey = getGameKey(game.shop, game.objectId);
const gameData = (await levelDBService.get(gameKey, "games")) as Game | null;
const gameData = (await levelDBService.get(
gameKey,
"games"
)) as Game | null;
if (gameData) {
const updated = { ...gameData, launchOptions: null };
await levelDBService.put(gameKey, updated, "games");
@@ -268,7 +274,10 @@ export function GameOptionsModal({
setAutomaticCloudSync(event.target.checked);
const gameKey = getGameKey(game.shop, game.objectId);
const gameData = (await levelDBService.get(gameKey, "games")) as Game | null;
const gameData = (await levelDBService.get(
gameKey,
"games"
)) as Game | null;
if (gameData) {
const updated = { ...gameData, automaticCloudSync: event.target.checked };
await levelDBService.put(gameKey, updated, "games");

View File

@@ -146,7 +146,10 @@ export function RepacksModal({
.get(gameKey, "games")
.then((gameData) => {
if (gameData) {
const updated = { ...(gameData as Game), newDownloadOptionsCount: undefined };
const updated = {
...(gameData as Game),
newDownloadOptionsCount: undefined,
};
return levelDBService.put(gameKey, updated, "games");
}
})