mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 10:24:39 +08:00
UX: rate limiter message will say to wait "a few seconds" instead of 0 to 3 seconds
This commit is contained in:
@ -11,7 +11,9 @@ class RateLimiter
|
||||
|
||||
def description
|
||||
time_left = ""
|
||||
if @available_in < 1.minute.to_i
|
||||
if @available_in <= 3
|
||||
time_left = I18n.t("rate_limiter.short_time")
|
||||
elsif @available_in < 1.minute.to_i
|
||||
time_left = I18n.t("rate_limiter.seconds", count: @available_in)
|
||||
elsif @available_in < 1.hour.to_i
|
||||
time_left = I18n.t("rate_limiter.minutes", count: (@available_in / 1.minute.to_i))
|
||||
|
Reference in New Issue
Block a user