mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-04-30 00:02:44 +00:00
feat(delete-chat): use window.location
to refresh page
This commit is contained in:
@ -11,7 +11,6 @@ import {
|
||||
import { Fragment, useState } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
import { Chat } from '@/app/library/page';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
const DeleteChat = ({
|
||||
chatId,
|
||||
@ -27,8 +26,6 @@ const DeleteChat = ({
|
||||
const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const handleDelete = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
@ -51,7 +48,7 @@ const DeleteChat = ({
|
||||
setChats(newChats);
|
||||
|
||||
if (redirect) {
|
||||
router.push('/');
|
||||
window.location.href = '/';
|
||||
}
|
||||
} catch (err: any) {
|
||||
toast.error(err.message);
|
||||
|
Reference in New Issue
Block a user