]> git.localhorst.tv Git - alttp.git/commitdiff
allow 0 chance for adlib setting
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 23 Jul 2024 12:43:29 +0000 (14:43 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 23 Jul 2024 12:43:29 +0000 (14:43 +0200)
resources/js/components/twitch-bot/ChatSettingsForm.js

index 24b2a0aca5146f39c4f98a8c256dc36a64925f60..5810a3fe72c6f9716198132a5d9fa5b24509fa34 100644 (file)
@@ -170,7 +170,8 @@ const ChatSettingsForm = ({
                                        onBlur={handleBlur}
                                        onChange={handleChange}
                                        type="number"
-                                       value={values.adlib || 1}
+                                       value={Object.prototype.hasOwnProperty.call(values, 'adlib')
+                                               ? values.adlib : 50}
                                />
                        </Form.Group>
                </Row>
@@ -235,7 +236,8 @@ export default withFormik({
                });
        },
        mapPropsToValues: ({ channel }) => ({
-               adlib: channel.chat_settings.adlib || 50,
+               adlib: Object.prototype.hasOwnProperty.call(channel.chat_settings, 'adlib')
+                       ? channel.chat_settings.adlib : 50,
                language: channel.chat_settings.language || channel.languages[0] || 'de',
                min_age: channel.chat_settings.min_age || 1,
                respond: channel.chat_settings.respond || 'yes',