diff --git a/frontend/src/components/HomePage.tsx b/frontend/src/components/HomePage.tsx index 24ca1be1..68a2f0d7 100644 --- a/frontend/src/components/HomePage.tsx +++ b/frontend/src/components/HomePage.tsx @@ -66,7 +66,9 @@ export const HomePage: React.FC = () => { } console.log('Setting up WebSocket with clientID:', userInfo.uuid); - const socketURL = `${url.backendURL.replace(/^http/, 'ws')}ws?clientID=${userInfo.uuid}`; + const socketURL = `${url.backendURL.replace(/^http/, 'ws')}ws?clientID=${ + userInfo.uuid + }`; const socket = new WebSocket(socketURL); socket.onopen = () => console.log('WebSocket connected!'); @@ -76,7 +78,11 @@ export const HomePage: React.FC = () => { try { const data = JSON.parse(event.data); if (data.status === 'success') { - getTasks(userInfo.email, userInfo.encryption_secret, userInfo.uuid); + // Skip refresh for Edit Task to prevent dialog blinking + if (data.job !== 'Edit Task') { + getTasks(userInfo.email, userInfo.encryption_secret, userInfo.uuid); + } + if (data.job === 'Add Task') { console.log('Task added successfully'); toast.success('Task added successfully!', {