UX: rate limiter message will say to wait "a few seconds" instead of 0 to 3 seconds

This commit is contained in:
Neil Lalonde 2018-06-18 14:14:26 -04:00
parent 913d97e780
commit 320cd9a19e
2 changed files with 4 additions and 1 deletions

View File

@ -600,6 +600,7 @@ en:
seconds:
one: "1 second"
other: "%{count} seconds"
short_time: "a few seconds"
datetime:
distance_in_words:

View File

@ -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))