Honor the share-link miss limit before querying, and keep Escape inside the access menu.
This commit is contained in:
1 parent
75649a9a42
commit
1b3d055c81
8 files changed
+189
-19
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user