From e37b838718e6106d60d64e5e3a5b5fc95680800c Mon Sep 17 00:00:00 2001 From: BizzleBot Date: Wed, 4 Mar 2026 22:34:57 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20silent=20email=20rate=20limit=20?= =?UTF-8?q?=E2=80=94=20no=20count/cooldown=20shown=20to=20users?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/Timesheet.jsx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/frontend/src/pages/Timesheet.jsx b/frontend/src/pages/Timesheet.jsx index 146c984..a2be804 100644 --- a/frontend/src/pages/Timesheet.jsx +++ b/frontend/src/pages/Timesheet.jsx @@ -254,7 +254,7 @@ export default function Timesheet() { try { const res = await api.post(`/timesheets/${timesheetId}/email`); setEmailStatus(s => ({ ...s, count: res.data.count, allowed: res.data.remaining > 0, cooldownMs: 30 * 60 * 1000 })); - setEmailResult({ ok: true, msg: `Sent! (${res.data.count}/${res.data.max} sends used for this week)` }); + setEmailResult({ ok: true, msg: 'Sent to Office!' }); setEmailConfirm(false); } catch (err) { setEmailResult({ ok: false, msg: err.response?.data?.error || 'Failed to send email' }); @@ -388,19 +388,15 @@ export default function Timesheet() {

Send to Office@CoastalContractingFL.com? - {emailStatus && ( - - {emailStatus.count}/{emailStatus.max} sends used this week - {emailStatus.cooldownMs > 0 ? ` ยท available in ${Math.ceil(emailStatus.cooldownMs / 60000)}m` : ''} - - )}

{emailStatus && !emailStatus.allowed ? ( -

- {emailStatus.count >= emailStatus.max - ? `Max ${emailStatus.max} sends reached for this timesheet` - : `Please wait ${Math.ceil(emailStatus.cooldownMs / 60000)} min before sending again`} -

+
+ + +
) : (