"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
}
