Don't set unavailable locales on the current user

This commit is contained in:
Matt-Yorkley
2020-07-02 12:56:20 +02:00
parent 8dfaea629b
commit aa6f4d4fb9

View File

@@ -7,7 +7,7 @@ module I18nHelper
end
# After logging in, check if the user chose a locale before
if current_user_locale.nil? && cookies[:locale]
if current_user_locale.nil? && cookies[:locale] && available_locale?(params[:locale])
spree_current_user&.update!(locale: params[:locale])
end