"pixel placed" notification entfernt
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { useState, useEffect, useCallback } from "react";
|
import { useState, useEffect, useCallback } from "react";
|
||||||
import { useQuery, useMutation } from "@tanstack/react-query";
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
||||||
import { queryClient } from "@/lib/queryClient";
|
import { queryClient } from "@/lib/queryClient";
|
||||||
import { Canvas } from "@/components/canvas";
|
import { OptimizedCanvas } from "@/components/optimized-canvas";
|
||||||
import { ColorPalette } from "@/components/color-palette";
|
import { ColorPalette } from "@/components/color-palette";
|
||||||
|
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
@@ -31,7 +31,7 @@ export default function CanvasPage() {
|
|||||||
|
|
||||||
const { data: recentPlacements = [] } = useQuery<Pixel[]>({
|
const { data: recentPlacements = [] } = useQuery<Pixel[]>({
|
||||||
queryKey: ['/api/recent'],
|
queryKey: ['/api/recent'],
|
||||||
refetchInterval: 5000, // Refresh every 5 seconds
|
refetchInterval: 10000, // Refresh every 10 seconds instead of 5
|
||||||
});
|
});
|
||||||
|
|
||||||
// WebSocket handling
|
// WebSocket handling
|
||||||
@@ -42,11 +42,11 @@ export default function CanvasPage() {
|
|||||||
queryClient.invalidateQueries({ queryKey: ['/api/pixels'] });
|
queryClient.invalidateQueries({ queryKey: ['/api/pixels'] });
|
||||||
queryClient.invalidateQueries({ queryKey: ['/api/recent'] });
|
queryClient.invalidateQueries({ queryKey: ['/api/recent'] });
|
||||||
|
|
||||||
toast({
|
//toast({
|
||||||
title: "Pixel placed",
|
// title: "Pixel placed",
|
||||||
description: `${message.data.username} placed a pixel at (${message.data.x}, ${message.data.y})`,
|
// description: `${message.data.username} placed a pixel at (${message.data.x}, ${message.data.y})`,
|
||||||
});
|
// });
|
||||||
break;
|
//break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -172,12 +172,11 @@ export default function CanvasPage() {
|
|||||||
|
|
||||||
{/* Main Canvas Area */}
|
{/* Main Canvas Area */}
|
||||||
<div className="flex-1 flex overflow-hidden">
|
<div className="flex-1 flex overflow-hidden">
|
||||||
<Canvas
|
<OptimizedCanvas
|
||||||
pixels={pixels}
|
pixels={pixels}
|
||||||
selectedColor={selectedColor}
|
selectedColor={selectedColor}
|
||||||
canvasWidth={config.canvasWidth}
|
canvasWidth={config.canvasWidth}
|
||||||
canvasHeight={config.canvasHeight}
|
canvasHeight={config.canvasHeight}
|
||||||
|
|
||||||
onPixelClick={handlePixelClick}
|
onPixelClick={handlePixelClick}
|
||||||
cooldownActive={cooldownSeconds > 0}
|
cooldownActive={cooldownSeconds > 0}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user