diff --git a/src/app/ItemPageLayout.js b/src/app/ItemPageLayout.js index e393a89f..38577bbc 100644 --- a/src/app/ItemPageLayout.js +++ b/src/app/ItemPageLayout.js @@ -105,6 +105,7 @@ export function SubtleSkeleton({ isLoaded, ...props }) { function ItemPageBadges({ item, isEmbedded }) { const searchBadgesAreLoaded = item?.name != null && item?.isNc != null; + const shouldShowOwls = useShouldShowOwls(); return ( @@ -150,7 +151,7 @@ function ItemPageBadges({ item, isEmbedded }) { Jellyneo - {item.isNc && ( + {item.isNc && shouldShowOwls && ( { + const onKeyPress = (e) => { + const newMostRecentKeys = [...mostRecentKeys, e.key].slice(-5); + if (newMostRecentKeys.join("") === "~owls") { + SHOULD_SHOW_OWLS = true; + setShouldShowOwls(true); + } + setMostRecentKeys(newMostRecentKeys); + }; + + window.addEventListener("keypress", onKeyPress); + return () => window.removeEventListener("keypress", onKeyPress); + }); + + return shouldShowOwls; +} + export default ItemPageLayout;