X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Ftwitch-bot%2FControls.js;h=bdc89380fe75c07a4a1ad22e8dd2587661d1ac1b;hb=a1f2759cc827baaa49f1869b88f676d4dc39bf10;hp=cc062e8aff53805bf4a78cfa6499c4ab81915cf0;hpb=06fbdc15c8db57590c9b6a38ee1f00d5f349cff9;p=alttp.git
diff --git a/resources/js/components/twitch-bot/Controls.js b/resources/js/components/twitch-bot/Controls.js
index cc062e8..bdc8938 100644
--- a/resources/js/components/twitch-bot/Controls.js
+++ b/resources/js/components/twitch-bot/Controls.js
@@ -4,6 +4,7 @@ import { Alert, Button, Col, Form, Row } from 'react-bootstrap';
import { useTranslation } from 'react-i18next';
import toastr from 'toastr';
+import ChatSettingsForm from './ChatSettingsForm';
import ChannelSelect from '../common/ChannelSelect';
import ToggleSwitch from '../common/ToggleSwitch';
@@ -45,6 +46,16 @@ const Controls = () => {
}
}, [channel, t]);
+ const saveChatSettings = React.useCallback(async (values) => {
+ try {
+ const rsp = await axios.post(`/api/channels/${channel.id}/chat-settings`, values);
+ setChannel(rsp.data);
+ toastr.success(t('twitchBot.saveSuccess'));
+ } catch (e) {
+ toastr.error(t('twitchBot.saveError'));
+ }
+ }, [channel, t]);
+
return <>
@@ -126,6 +137,10 @@ const Controls = () => {
+
+ {t('twitchBot.chatSettings')}
+
+
: