mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 23:12:33 -05:00
allow to disable confetti
This commit is contained in:
1 parent
2d0f323854
commit
633e5ac5e4
6 files changed
+39
-9
No files matched your search
@@ -8,7 +8,8 @@ class AccountConfigsController < ApplicationController
|
||||
AccountConfig::ALLOW_TYPED_SIGNATURE,
|
||||
AccountConfig::FORCE_MFA,
|
||||
AccountConfig::ALLOW_TO_RESUBMIT,
|
||||
AccountConfig::ESIGNING_PREFERENCE_KEY
|
||||
AccountConfig::ESIGNING_PREFERENCE_KEY,
|
||||
AccountConfig::FORM_WITH_CONFETTI_KEY
|
||||
].freeze
|
||||
|
||||
InvalidKey = Class.new(StandardError)
|
||||
|
||||
@@ -17,7 +17,11 @@ class PersonalizationSettingsController < ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
@account_config.save!
|
||||
if @account_config.value != false && @account_config.value.blank?
|
||||
@account_config.destroy!
|
||||
else
|
||||
@account_config.save!
|
||||
end
|
||||
|
||||
redirect_back(fallback_location: settings_personalization_path, notice: 'Settings have been saved.')
|
||||
end
|
||||
@@ -40,6 +44,8 @@ class PersonalizationSettingsController < ApplicationController
|
||||
def account_config_params
|
||||
attrs = params.require(:account_config).permit!
|
||||
|
||||
return attrs if attrs[:value].is_a?(String)
|
||||
|
||||
attrs[:value]&.transform_values! do |value|
|
||||
if value.in?(%w[true false])
|
||||
value == 'true'
|
||||
|
||||
Reference in new issue
Block a user