diff --git a/src/components/EmailNotifications.tsx b/src/components/EmailNotifications.tsx index f88e2fb..05828a4 100644 --- a/src/components/EmailNotifications.tsx +++ b/src/components/EmailNotifications.tsx @@ -19,8 +19,8 @@ export const EmailNotifications: React.FC = ({ const { socket, isConnected } = useEmailWebSocket({ token: userToken, - onConnect: () => console.log('نوتیفیکیشن‌های ایمیل متصل شد'), - onError: (error) => console.error('خطای WebSocket:', error), + onConnect: () => null, + onError: () => null, }); // Sound settings state @@ -47,7 +47,6 @@ export const EmailNotifications: React.FC = ({ }); const handleNewEmail = useCallback((email: EmailPayload) => { - console.log('📧 ایمیل جدید دریافت شد:', email); // Add to notifications list setNotifications(prev => [email, ...prev.slice(0, 9)]); // Keep only 10 latest @@ -97,7 +96,6 @@ export const EmailNotifications: React.FC = ({ {/* Test Sound Button */} diff --git a/src/components/Table.tsx b/src/components/Table.tsx index 405ae38..b271de2 100644 --- a/src/components/Table.tsx +++ b/src/components/Table.tsx @@ -370,7 +370,7 @@ const Table = ({ return (
-
+
{actions} {selectable && selectedRows.length > 0 && selectedActions && selectedActions}
@@ -471,7 +471,6 @@ const Table = ({
{pagination && (() => { - console.log('Table component rendering pagination:', pagination); return ( = (props: Props) => { if (props.preview && props.preview.length > 0 && !isFill) { setPerviews(props.preview) - console.log('preview', props.preview); setIsFill(true) } diff --git a/src/hooks/useEmailWebSocket.ts b/src/hooks/useEmailWebSocket.ts index 2885d0f..eb6c685 100644 --- a/src/hooks/useEmailWebSocket.ts +++ b/src/hooks/useEmailWebSocket.ts @@ -28,23 +28,18 @@ export const useEmailWebSocket = ({ // Connection events newSocket.on("connect", () => { - console.log("✅ اتصال به WebSocket ایمیل برقرار شد"); setIsConnected(true); onConnect?.(); }); newSocket.on("disconnect", () => { - console.log("❌ اتصال به WebSocket ایمیل قطع شد"); setIsConnected(false); onDisconnect?.(); }); - newSocket.on("connection_established", (data) => { - console.log("🎉 اتصال We bSocket ایمیل تأیید شد:", data); - }); + newSocket.on("connection_established", () => {}); newSocket.on("connection_error", (error) => { - console.error("💥 خطای اتصال WebSocket ایمیل:", error); onError?.(error.error); }); diff --git a/src/hooks/useNotificationSound.ts b/src/hooks/useNotificationSound.ts index 0d2c07a..3766dd0 100644 --- a/src/hooks/useNotificationSound.ts +++ b/src/hooks/useNotificationSound.ts @@ -15,13 +15,11 @@ export const useNotificationSound = ({ const playSound = useCallback(async () => { if (!enabled || isPlaying) { - console.log("صدا غیرفعال است یا در حال پخش"); return; } try { setIsPlaying(true); - console.log("شروع پخش صدا...", { soundUrl, volume, enabled }); const audio = new Audio(); audio.preload = "auto"; @@ -30,32 +28,26 @@ export const useNotificationSound = ({ // Add event listeners audio.addEventListener("ended", () => { - console.log("پخش صدا تمام شد"); setIsPlaying(false); }); - audio.addEventListener("error", (e) => { - console.error("خطا در پخش صدا:", e); + audio.addEventListener("error", () => { setIsPlaying(false); }); // Wait for audio to be ready if (audio.readyState >= 2) { await audio.play(); - console.log("🔊 صدای نوتیفیکیشن پخش شد"); } else { audio.addEventListener("canplay", async () => { try { await audio.play(); - console.log("🔊 صدای نوتیفیکیشن پخش شد"); - } catch (playError) { - console.error("خطا در پخش بعد از آماده شدن:", playError); + } catch { setIsPlaying(false); } }); } - } catch (error) { - console.error("خطا در ایجاد audio element:", error); + } catch { setIsPlaying(false); } }, [enabled, isPlaying, soundUrl, volume]); diff --git a/src/pages/Trash/List.tsx b/src/pages/Trash/List.tsx index e16dca0..1c5f4e9 100644 --- a/src/pages/Trash/List.tsx +++ b/src/pages/Trash/List.tsx @@ -131,7 +131,7 @@ const List: FC = () => { }; const tableActions = ( -
+
{ }; const tableActions = ( -
+
{ className={`cursor-pointer ${isFetching ? 'animate-spin-reverse' : ''}`} onClick={() => refetch()} /> -
); diff --git a/src/pages/draft/List.tsx b/src/pages/draft/List.tsx index 38da55c..96487d5 100644 --- a/src/pages/draft/List.tsx +++ b/src/pages/draft/List.tsx @@ -3,7 +3,7 @@ import { FC, useState } from 'react' import { useTranslation } from 'react-i18next' import Table from '../../components/Table'; import { ColumnType } from '../../components/types/TableTypes'; -import { InfoCircle, More, Refresh2, Trash, Edit, Send } from 'iconsax-react'; +import { InfoCircle, Refresh2, Trash, Edit, Send } from 'iconsax-react'; import { RowActionItem } from '../../components/RowActionsDropdown'; import { useNavigate } from 'react-router-dom'; import { useGetDrafts } from './hooks/useDraftData'; @@ -145,7 +145,7 @@ const List: FC = () => { }; const tableActions = ( -
+
{ className={`cursor-pointer ${isFetching ? 'animate-spin-reverse' : ''}`} onClick={() => refetch()} /> -
); @@ -218,8 +217,6 @@ const List: FC = () => { const handleEditSelected = () => { if (selectedMessages.length === 1) { navigate(`/draft/edit/${selectedMessages[0].id}`); - } else { - console.log('ویرایش چندین پیش‌نویس انتخاب شده:', selectedMessages.map(m => m.id)); } setSelectedMessages([]); setSelectAll(false); diff --git a/src/pages/favorite/List.tsx b/src/pages/favorite/List.tsx index 059995f..0c8df15 100644 --- a/src/pages/favorite/List.tsx +++ b/src/pages/favorite/List.tsx @@ -2,7 +2,7 @@ import Filters, { FilterValues } from '../../components/Filters'; import { FC, useState } from 'react' import Table from '../../components/Table'; import { ColumnType } from '../../components/types/TableTypes'; -import { InfoCircle, More, Refresh2, Trash, Archive, Star1 } from 'iconsax-react'; +import { InfoCircle, Refresh2, Trash, Archive, Star1 } from 'iconsax-react'; import { RowActionItem } from '../../components/RowActionsDropdown'; import { useNavigate } from 'react-router-dom'; import { useGetFavoriteMessages } from './hooks/useFavoriteData'; @@ -128,7 +128,7 @@ const List: FC = () => { }; const tableActions = ( -
+
{ className={`cursor-pointer ${isFetching ? 'animate-spin-reverse' : ''}`} onClick={() => refetch()} /> -
); diff --git a/src/pages/received/Detail.tsx b/src/pages/received/Detail.tsx index f552d6c..91e3379 100644 --- a/src/pages/received/Detail.tsx +++ b/src/pages/received/Detail.tsx @@ -118,7 +118,6 @@ const DetailEmail: FC = () => { // Mark message as seen when it's loaded and not already seen useEffect(() => { if (messageDetail && !messageDetail.seen && id) { - console.log('Marking message as seen:', id, 'Current seen status:', messageDetail.seen) emailActions.markAsSeen({ messageId: Number(id), mailbox: mailbox || '' }) } }, [messageDetail, emailActions, id]) diff --git a/src/pages/received/List.tsx b/src/pages/received/List.tsx index ab4e2f1..17c7895 100644 --- a/src/pages/received/List.tsx +++ b/src/pages/received/List.tsx @@ -149,7 +149,7 @@ const List: FC = () => { }; const tableActions = ( -
+
{ }; const tableActions = ( -
+
{ }; const tableActions = ( -
+
{ className={`cursor-pointer ${isFetching ? 'animate-spin-reverse' : ''}`} onClick={() => refetch()} /> -
); diff --git a/src/pages/spam/List.tsx b/src/pages/spam/List.tsx index f3f6731..0a529e8 100644 --- a/src/pages/spam/List.tsx +++ b/src/pages/spam/List.tsx @@ -127,7 +127,7 @@ const List: FC = () => { }; const tableActions = ( -
+
{ const handleNotSpamSelected = () => { // TODO: پیاده‌سازی علامت‌گذاری به عنوان غیر اسپم - نیاز به API endpoint جداگانه - console.log('علامت‌گذاری به عنوان غیر اسپم:', selectedMessages.map(m => m.id)); setSelectedMessages([]); setSelectAll(false); }; @@ -200,7 +199,7 @@ const List: FC = () => { { label: 'غیر اسپم', icon: , - onClick: () => console.log('علامت‌گذاری به عنوان غیر اسپم', message.id), + onClick: () => null, }, { label: 'حذف',