From 7fff58786f2c74320893bebc2162ecb5eac2308e Mon Sep 17 00:00:00 2001 From: marcin2121 <13873718+marcin2121@users.noreply.github.com> Date: Tue, 31 Mar 2026 20:34:08 +0000 Subject: [PATCH] chore: improve code health in FeedingGame - Replaced debug console.log with a user-facing toast notification for offline sync errors - Removed unnecessary console.log inside the failed response check - Imported toast from sonner Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- components/urwisek/games/FeedingGame.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/urwisek/games/FeedingGame.tsx b/components/urwisek/games/FeedingGame.tsx index 9ff4246..961b25f 100644 --- a/components/urwisek/games/FeedingGame.tsx +++ b/components/urwisek/games/FeedingGame.tsx @@ -1,6 +1,7 @@ 'use client' import React, { useState, useRef } from 'react' import { motion, useAnimation, AnimatePresence, PanInfo } from 'framer-motion' +import { toast } from 'sonner' export default function FeedingGame({ onComplete }: { onComplete: () => void }) { const [foodCount, setFoodCount] = useState(0) @@ -20,11 +21,10 @@ export default function FeedingGame({ onComplete }: { onComplete: () => void }) if (!response.ok) { // Serwist przechwyci to nieudane żądanie i doda do kolejki IndexedDB - console.log("Żądanie nieudane - Serwist dodał je do kolejki synchronizacji."); } } catch (_err) { // Fetch rzuca wyjątek przy całkowitym braku sieci - console.log("Brak sieci. Punkty zostaną wysłane automatycznie w tle po odzyskaniu połączenia."); + toast.info("Brak sieci. Punkty zostaną wysłane automatycznie w tle po odzyskaniu połączenia."); } };