Small tweak
This commit is contained in:
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
import { COOKIE_VALUES } from "@/data/general"
|
import { COOKIE_VALUES } from "@/data/general"
|
||||||
import Cookies from "js-cookie"
|
import Cookies from "js-cookie"
|
||||||
|
import { useRouter } from "next/navigation"
|
||||||
import { toast } from "sonner"
|
import { toast } from "sonner"
|
||||||
import { Button } from "./ui/button"
|
import { Button } from "./ui/button"
|
||||||
|
|
||||||
export default function ClearCookiesButton() {
|
export default function ClearCookiesButton() {
|
||||||
|
const router = useRouter()
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -22,6 +24,7 @@ export default function ClearCookiesButton() {
|
|||||||
if (existing === 0) {
|
if (existing === 0) {
|
||||||
toast.success("No cookies to clear")
|
toast.success("No cookies to clear")
|
||||||
} else {
|
} else {
|
||||||
|
router.refresh()
|
||||||
toast.success("Cleared " + existing + " cookies")
|
toast.success("Cleared " + existing + " cookies")
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user