Skip to content

Commit

Permalink
Only show the "too many messages" error once
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Aug 23, 2020
1 parent 04dcea6 commit 8d34b03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/messages_controller.rb
Expand Up @@ -27,7 +27,7 @@ def create
@message.sent_on = Time.now.getutc

if current_user.sent_messages.where("sent_on >= ?", Time.now.getutc - 1.hour).count >= Settings.max_messages_per_hour
flash[:error] = t ".limit_exceeded"
flash.now[:error] = t ".limit_exceeded"
render :action => "new"
elsif @message.save
flash[:notice] = t ".message_sent"
Expand Down

0 comments on commit 8d34b03

Please sign in to comment.