Add autoClaim feature to ClaimTimerView and adjust cache claiming logic in GlobalMapScreen

This commit is contained in:
bobbert committed 2026-04-09 23:06:57 +01:00
1 parent dc18186265
commit caf90d2d93
3 files changed
+30 -19

No files matched your search

+6 -6
View File
@@ -1,11 +1,11 @@
import { useCallback, useMemo } from "react";
import {useCallback, useMemo} from "react";
import API from "../components/API/API";
import globalApiConfig from "../components/API/api.json";
import {
clearGlobalDataCache,
clearGlobalDataCacheByPrefix,
getOrFetchGlobalData,
writeGlobalDataCache,
clearGlobalDataCache,
clearGlobalDataCacheByPrefix,
getOrFetchGlobalData,
writeGlobalDataCache,
} from "../utils/globalDataCache";
const GLOBAL_BASE = String(
@@ -303,7 +303,7 @@ const useGlobalHook = () => {
if (!isGlobalApiReady()) return null;
const response = await API.post(withKey(endpoints.finds), data);
if (!response.isSuccess) return null;
const find = unwrapSingle(response.result);
const find = unwrapSingle(response.result) || { ...data };
if (data?.FindPlayerID !== undefined && data?.FindPlayerID !== null) {
clearGlobalDataCache(CACHE_KEY.findsByPlayer(data.FindPlayerID));
}