Prevent use locale with empty string (#18543)
Somehow user's locale could be an empty string, And empty string itself are treated as true value.
This commit is contained in:
parent
0ac6e5d434
commit
fed7380e9f
3 changed files with 26 additions and 20 deletions
|
@ -51,7 +51,7 @@ class Web::PushNotificationWorker
|
|||
private
|
||||
|
||||
def push_notification_json
|
||||
json = I18n.with_locale(@subscription.locale || I18n.default_locale) do
|
||||
json = I18n.with_locale(@subscription.locale.presence || I18n.default_locale) do
|
||||
ActiveModelSerializers::SerializableResource.new(
|
||||
@notification,
|
||||
serializer: Web::NotificationSerializer,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue