Skip to content

Commit 582fdb2

Browse files
authored
fix: task dialog refresh during edits (#287)
Skip WebSocket refresh for Edit Task operations Prevents dialog from disappearing when editing fields
1 parent ec90d20 commit 582fdb2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

frontend/src/components/HomePage.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ export const HomePage: React.FC = () => {
6666
}
6767

6868
console.log('Setting up WebSocket with clientID:', userInfo.uuid);
69-
const socketURL = `${url.backendURL.replace(/^http/, 'ws')}ws?clientID=${userInfo.uuid}`;
69+
const socketURL = `${url.backendURL.replace(/^http/, 'ws')}ws?clientID=${
70+
userInfo.uuid
71+
}`;
7072
const socket = new WebSocket(socketURL);
7173

7274
socket.onopen = () => console.log('WebSocket connected!');
@@ -76,7 +78,11 @@ export const HomePage: React.FC = () => {
7678
try {
7779
const data = JSON.parse(event.data);
7880
if (data.status === 'success') {
79-
getTasks(userInfo.email, userInfo.encryption_secret, userInfo.uuid);
81+
// Skip refresh for Edit Task to prevent dialog blinking
82+
if (data.job !== 'Edit Task') {
83+
getTasks(userInfo.email, userInfo.encryption_secret, userInfo.uuid);
84+
}
85+
8086
if (data.job === 'Add Task') {
8187
console.log('Task added successfully');
8288
toast.success('Task added successfully!', {

0 commit comments

Comments
 (0)