From 0176792cb95d6014be2c1b11f33cd0eccfd85ef6 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 15 Sep 2022 04:04:13 -0700 Subject: [PATCH] Delete usePageTitle We got rid of all its call sites, hooray! --- src/app/util.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/app/util.js b/src/app/util.js index b2cb221..1950306 100644 --- a/src/app/util.js +++ b/src/app/util.js @@ -224,30 +224,6 @@ export function useDebounce( return shouldForceReset ? value : debouncedValue; } -/** - * usePageTitle sets the page title! - */ -export function usePageTitle(title, { skip = false } = {}) { - React.useEffect(() => { - if (skip) return; - try { - document.title = title - ? `${title} | Dress to Impress` - : "Dress to Impress"; - } catch (e) { - // I've been seeing Sentry errors that we can't read `title` of - // undefined, with no traceback. This is the only `.title` I see in our - // codebase, aside from unpacking props that I'm pretty sure aren't - // null... so I'm adding this to help confirm! - logAndCapture( - new Error( - `Could not set page title: ${e.message}. Document is: ${document}.` - ) - ); - } - }, [title, skip]); -} - /** * useFetch uses `fetch` to fetch the given URL, and returns the request state. *