Skip to content

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

Move enable save button logic to a use effect hook. This updates state without delay. (#2548)

Harpreet Singhe9521262835e
diff --git a/web/components/config/notification/twitter.tsx b/web/components/config/notification/twitter.tsx
index c31d99c438..4dd8503051 100644
--- a/web/components/config/notification/twitter.tsx
+++ b/web/components/config/notification/twitter.tsx
@@ -66,14 +66,16 @@ export const ConfigNotify = () => {
);
};
+ useEffect(() => {
+ setEnableSaveButton(canSave());
+ }, [formDataValues]);
+
// update individual values in state
const handleFieldChange = ({ fieldName, value }: UpdateArgs) => {
setFormDataValues({
...formDataValues,
[fieldName]: value,
});
-
- setEnableSaveButton(canSave());
};
// toggle switch.