20 lines
337 B
TypeScript
20 lines
337 B
TypeScript
"use client"
|
|
|
|
import { useEffect } from "react"
|
|
|
|
type FlashQueryCleanupProps = {
|
|
enabled: boolean
|
|
}
|
|
|
|
export function FlashQueryCleanup({ enabled }: FlashQueryCleanupProps) {
|
|
useEffect(() => {
|
|
if (!enabled) {
|
|
return
|
|
}
|
|
|
|
window.history.replaceState(window.history.state, "", "/media")
|
|
}, [enabled])
|
|
|
|
return null
|
|
}
|