Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

fix: remove optimistic UI updates in external actions to prevent race condition (#4711)

John Costaa0de2dd40bc2
diff --git a/web/pages/admin/actions.tsx b/web/pages/admin/actions.tsx
index 367d813bb7..8e95186b98 100644
--- a/web/pages/admin/actions.tsx
+++ b/web/pages/admin/actions.tsx
@@ -274,8 +274,10 @@ const Actions = () => {
actionsData.splice(index, 1);
try {
- setActions(actionsData);
- save(actionsData);
+ // Don't optimistically update local state - let the server response
+ // update externalActions in context, which will then update actions
+ // via useEffect. This prevents race conditions causing visual glitches.
+ await save(actionsData);
} catch (error) {
console.error(error);
}
@@ -312,7 +314,9 @@ const Actions = () => {
actionsData.push(newAction);
}
- setActions(actionsData);
+ // Don't optimistically update local state - let the server response
+ // update externalActions in context, which will then update actions
+ // via useEffect. This prevents race conditions causing visual glitches.
await save(actionsData);
} catch (error) {
console.error(error);