diff --git a/app/javascript/form.js b/app/javascript/form.js index 1fbd54c8..00ec8743 100644 --- a/app/javascript/form.js +++ b/app/javascript/form.js @@ -36,7 +36,7 @@ safeRegisterElement('submission-form', class extends HTMLElement { expand: ['true', 'false'].includes(this.dataset.expand) ? this.dataset.expand === 'true' : null, withSignatureId: this.dataset.withSignatureId === 'true', requireSigningReason: this.dataset.requireSigningReason === 'true', - withConfetti: this.dataset.withConfetti !== 'false', + withConfetti: this.dataset.withConfetti === 'true', withFieldLabels: this.dataset.withFieldLabels !== 'false', withDisclosure: this.dataset.withDisclosure === 'true', reuseSignature: this.dataset.reuseSignature !== 'false', diff --git a/app/views/personalization_settings/_form_toggle_options.html.erb b/app/views/personalization_settings/_form_toggle_options.html.erb index f57dbee8..195ef0f1 100644 --- a/app/views/personalization_settings/_form_toggle_options.html.erb +++ b/app/views/personalization_settings/_form_toggle_options.html.erb @@ -1,4 +1,4 @@ -<% account_config = AccountConfig.where(account: current_account, key: AccountConfig::FORM_WITH_CONFETTI_KEY).first_or_initialize(value: true) %> +<% account_config = AccountConfig.where(account: current_account, key: AccountConfig::FORM_WITH_CONFETTI_KEY).first_or_initialize(value: false) %> <% if can?(:manage, account_config) %>
<%= form_for account_config, url: account_configs_path, method: :post do |f| %> @@ -8,7 +8,7 @@ <%= t('show_confetti_on_successful_completion') %> - <%= f.check_box :value, { class: 'toggle', checked: account_config.value != false }, '1', '0' %> + <%= f.check_box :value, { class: 'toggle', checked: account_config.value == true }, '1', '0' %>
<% end %> diff --git a/lib/submitters/form_configs.rb b/lib/submitters/form_configs.rb index 3ebf9118..1b21fa70 100644 --- a/lib/submitters/form_configs.rb +++ b/lib/submitters/form_configs.rb @@ -28,7 +28,7 @@ module Submitters completed_button = find_safe_value(configs, AccountConfig::FORM_COMPLETED_BUTTON_KEY) || {} completed_message = find_safe_value(configs, AccountConfig::FORM_COMPLETED_MESSAGE_KEY) || {} with_typed_signature = find_safe_value(configs, AccountConfig::ALLOW_TYPED_SIGNATURE) != false - with_confetti = find_safe_value(configs, AccountConfig::FORM_WITH_CONFETTI_KEY) != false + with_confetti = find_safe_value(configs, AccountConfig::FORM_WITH_CONFETTI_KEY) == true prefill_signature = find_safe_value(configs, AccountConfig::FORM_PREFILL_SIGNATURE_KEY) != false reuse_signature = find_safe_value(configs, AccountConfig::REUSE_SIGNATURE_KEY) != false with_decline = find_safe_value(configs, AccountConfig::ALLOW_TO_DECLINE_KEY) != false