Honor the share-link miss limit before querying, and keep Escape inside the access menu.

This commit is contained in:
adilallo committed 2026-11-21 11:56:34 -07:00
1 parent 75649a9a42
commit 1b3d055c81
8 files changed
+189 -19

No files matched your search

+9
View File
@@ -18,3 +18,12 @@ export function rateLimitKey(
windows.set(key, now);
return { ok: true };
}
/** True when `key` is still inside the interval started by the last allowed call. */
export function rateLimitCoolingDown(
key: string,
minIntervalMs: number,
): boolean {
const last = windows.get(key) ?? 0;
return Date.now() - last < minIntervalMs;
}