From 55d8908cf5ed3d2b1bbe9bbef77cf3198f0d4530 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 11 Feb 2023 19:36:28 +0800 Subject: [PATCH] For page not loading when logged out Because path is undefined --- src/utils/useTitle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/useTitle.js b/src/utils/useTitle.js index 38989fb6..e4a53825 100644 --- a/src/utils/useTitle.js +++ b/src/utils/useTitle.js @@ -19,7 +19,7 @@ export default function useTitle(title, path) { let matched = false; if (paths.length) { matched = paths.some((p) => matchPath(p, currentLocation)); - } else { + } else if (path) { matched = matchPath(path, currentLocation); } console.debug({ paths, matched, currentLocation });