chore: update content, sitemap and lib files
This commit is contained in:
@@ -31,7 +31,7 @@ export const useConsentStore = create<ConsentState>((set) => ({
|
||||
if (typeof window !== 'undefined') {
|
||||
let stored = localStorage.getItem(CONSENT_KEY);
|
||||
|
||||
// Migration logic
|
||||
|
||||
if (!stored) {
|
||||
const oldStored = localStorage.getItem(OLD_CONSENT_KEY);
|
||||
if (oldStored) {
|
||||
@@ -47,7 +47,6 @@ export const useConsentStore = create<ConsentState>((set) => ({
|
||||
localStorage.setItem(CONSENT_KEY, stored);
|
||||
localStorage.removeItem(OLD_CONSENT_KEY);
|
||||
} catch {
|
||||
// Ignore if parse fails
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,11 +63,9 @@ export const useConsentStore = create<ConsentState>((set) => ({
|
||||
advertising: !!parsed.advertising,
|
||||
});
|
||||
} catch {
|
||||
// If parsing fails, show banner
|
||||
set({ isInitialized: true, isOpen: true });
|
||||
}
|
||||
} else {
|
||||
// No consent found, show banner
|
||||
set({ isInitialized: true, isOpen: true });
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,10 +12,10 @@ export function escapeHtml(unsafe: string): string {
|
||||
|
||||
const rateLimitMap = new Map<string, { count: number; expiresAt: number }>();
|
||||
const MAX_REQUESTS = 5;
|
||||
const WINDOW_MS = 10 * 60 * 1000; // 10 minutes
|
||||
const WINDOW_MS = 10 * 60 * 1000;
|
||||
|
||||
export function rateLimit(ip: string | undefined | null): boolean {
|
||||
if (!ip) return true; // fallback if IP can't be resolved
|
||||
if (!ip) return true;
|
||||
|
||||
const now = Date.now();
|
||||
const entry = rateLimitMap.get(ip);
|
||||
|
||||
Reference in New Issue
Block a user