Update cookies[:locale] logic

This commit is contained in:
Matt-Yorkley
2020-07-03 14:06:05 +02:00
parent faa7c0a7c5
commit ebffa381c6

View File

@@ -45,9 +45,9 @@ class UserLocaleSetter
def save_locale_from_cookies
return unless current_user_locale.nil? && cookies[:locale] &&
available_locale?(params_locale)
available_locale?(cookies[:locale])
current_user&.update!(locale: params_locale)
current_user&.update!(locale: cookies[:locale])
end
def available_locale?(locale)