cloudflare-next-intl 0.8.43 → 0.8.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,9 @@ import { useLocale } from "./client_hooks";
13
13
  export default function usePathname() {
14
14
  const pathname = nextUsePathname();
15
15
  const locale = useLocale();
16
+ if (!pathname) {
17
+ return '/';
18
+ }
16
19
  const path = pathname.replace(`/${locale}`, '');
17
20
  if (path) {
18
21
  return path;
@@ -116,7 +116,7 @@ export default function CookieConsentProvider({ requiresConsent = true, children
116
116
  // `pathname` still carries the locale prefix (e.g. `/de/privacy-policy`),
117
117
  // so match on a trailing segment rather than strict equality.
118
118
  useEffect(() => {
119
- if (privacyPolicyUpdated && privacyPolicyPath !== false && pathname.endsWith(privacyPolicyPath)) {
119
+ if (privacyPolicyUpdated && privacyPolicyPath !== false && pathname?.endsWith(privacyPolicyPath)) {
120
120
  acknowledgePrivacyPolicyUpdate();
121
121
  }
122
122
  }, [pathname, privacyPolicyUpdated, privacyPolicyPath, acknowledgePrivacyPolicyUpdate]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudflare-next-intl",
3
- "version": "0.8.43",
3
+ "version": "0.8.44",
4
4
  "description": "Optimized Next Intl Package Special for App Router and Cloudflare",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",