From 8c3b77e8e5d73f30f4beefcd05e1c4261c66ed1c Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Mon, 23 Mar 2026 14:46:10 +0100 Subject: [PATCH] Revert "fix(pagespeed): make frequency interactive and show next check time" This reverts commit 01c50ab971be69d6d8eb9daa99c93e5e8d53a1b7. --- app/sites/[id]/pagespeed/page.tsx | 71 ++++++------------------------- 1 file changed, 13 insertions(+), 58 deletions(-) diff --git a/app/sites/[id]/pagespeed/page.tsx b/app/sites/[id]/pagespeed/page.tsx index 8ef7e7d..6ff082c 100644 --- a/app/sites/[id]/pagespeed/page.tsx +++ b/app/sites/[id]/pagespeed/page.tsx @@ -49,18 +49,6 @@ function formatTimeAgo(dateString: string | null): string { return `${Math.floor(diffSec / 86400)}d ago` } -function formatTimeUntil(dateString: string | null): string | null { - if (!dateString) return null - const date = new Date(dateString) - const now = new Date() - const diffMs = date.getTime() - now.getTime() - if (diffMs <= 0) return 'soon' - const diffSec = Math.floor(diffMs / 1000) - if (diffSec < 3600) return `in ${Math.floor(diffSec / 60)}m` - if (diffSec < 86400) return `in ${Math.floor(diffSec / 3600)}h` - return `in ${Math.floor(diffSec / 86400)}d` -} - // * Get dot color for audit items based on score function getAuditDotColor(score: number | null): string { if (score === null) return 'bg-neutral-400' @@ -187,18 +175,6 @@ export default function PageSpeedPage() { } } - // * Change frequency inline (without disabling/re-enabling) - const handleFrequencyChange = async (newFrequency: string) => { - setFrequency(newFrequency) - try { - await updatePageSpeedConfig(siteId, { enabled: true, frequency: newFrequency }) - mutateConfig() - } catch { - toast.error('Failed to update check frequency') - if (config?.frequency) setFrequency(config.frequency) - } - } - // * Trigger a manual PageSpeed check const pollRef = useRef | null>(null) const stopPolling = useCallback(() => { @@ -424,13 +400,14 @@ export default function PageSpeedPage() { > {running ? 'Running...' : 'Run Check'} - + )} @@ -466,7 +443,7 @@ export default function PageSpeedPage() {