feat: nak req

This commit is contained in:
codytseng 2025-12-10 23:10:47 +08:00
parent ac196cd662
commit a6d6a19199
9 changed files with 388 additions and 25 deletions

View file

@ -81,6 +81,21 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) {
const { enableSingleColumnLayout } = useUserPreferences()
const ignorePopStateRef = useRef(false)
useEffect(() => {
if (isSmallScreen) return
const handleKeyDown = (e: KeyboardEvent) => {
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
e.preventDefault()
navigatePrimaryPage('search')
}
}
window.addEventListener('keydown', handleKeyDown)
return () => {
window.removeEventListener('keydown', handleKeyDown)
}
}, [isSmallScreen])
useEffect(() => {
if (['/npub1', '/nprofile1'].some((prefix) => window.location.pathname.startsWith(prefix))) {
window.history.replaceState(