Skip to content

Commit

Permalink
Store selected color scheme in cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Nov 16, 2024
1 parent d6e083a commit af06e41
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/preferences_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ def update
else
params[:user][:preferred_editor]
end

cookies["_osm_color_scheme"] = {
:value => params[:color_scheme],
:expires => 10.years.from_now
}

if current_user.save
# Use a partial so that it is rendered during the next page load in the correct language.
flash[:notice] = { :partial => "preferences/update_success_flash" }
Expand Down

0 comments on commit af06e41

Please sign in to comment.