diff --git a/packages/next-deploy-notifications/src/hooks/use-has-new-deploy.ts b/packages/next-deploy-notifications/src/hooks/use-has-new-deploy.ts index b17be84..1038a42 100644 --- a/packages/next-deploy-notifications/src/hooks/use-has-new-deploy.ts +++ b/packages/next-deploy-notifications/src/hooks/use-has-new-deploy.ts @@ -4,7 +4,7 @@ import useWindowFocus from "use-window-focus"; let getCurrentVersion = async (endpoint: string) => { let response = await fetch(endpoint); - if (response.status > 400) { + if (response.status >= 400) { console.error( "[next-deploy-notifications] Could not find current app version. Did you setup the API route?" ); @@ -31,7 +31,7 @@ type UseHasNewDeploy = (options?: HookOptions) => HookValues; let useHasNewDeploy: UseHasNewDeploy = (options = {}) => { let debug = (message: string) => { if (options.debug) { - console.log(...["[Deploy notifications] ", message]); + console.log("[Deploy notifications] ", message); } }; @@ -44,7 +44,7 @@ let useHasNewDeploy: UseHasNewDeploy = (options = {}) => { let endpoint = options.endpoint ?? "/api/has-new-deploy"; let isUnknown = currentVersion === "unknown"; - let loopInterval = interval < 3_000 ? interval : 3_000; + let loopInterval = interval > 3_000 ? interval : 3_000; let loopOrNotInterval = !hasNewDeploy && windowFocused ? loopInterval : null; useInterval(async () => {