From 719431f1ebd26c2047bbe547f89ea7bdcad35402 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Tue, 23 Jul 2024 14:43:29 +0200 Subject: [PATCH] allow 0 chance for adlib setting --- resources/js/components/twitch-bot/ChatSettingsForm.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/js/components/twitch-bot/ChatSettingsForm.js b/resources/js/components/twitch-bot/ChatSettingsForm.js index 24b2a0a..5810a3f 100644 --- a/resources/js/components/twitch-bot/ChatSettingsForm.js +++ b/resources/js/components/twitch-bot/ChatSettingsForm.js @@ -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} /> @@ -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', -- 2.39.2