Refactor claim distance and update cache claiming logic in GlobalMapScreen and usePlayerGame

This commit is contained in:
bobbert committed 2026-04-09 22:57:24 +01:00
1 parent 1948fb4d90
commit dc18186265
2 files changed
+7 -5

No files matched your search

@@ -78,6 +78,7 @@ const GlobalMapScreen = ({ navigation, route }) => {
claimableCaches,
GLOBAL_CLAIM_DISTANCE_METERS,
selectedCacheId,
false,
);
// Handlers ----------------------------
@@ -132,12 +133,11 @@ const GlobalMapScreen = ({ navigation, route }) => {
setIsClaiming(false);
if (result) {
const points = Number(claimedCache?.CachePoints ?? 10);
const cacheName = claimedCache?.CacheName || "Cache";
setFoundCacheIds((prev) =>
prev.includes(cacheId) ? prev : [...prev, cacheId],
);
setClaimedPopupMessage(`${cacheName} claimed! You gained +${points} points.`);
setClaimedPopupMessage(`${cacheName} claimed! You gained +10 points.`);
setClaimedPopupVisible(true);
setTimeout(() => setClaimedPopupVisible(false), 3000);
}