From f53b620df56cd30f9429b5f435a97dac4f00e1f3 Mon Sep 17 00:00:00 2001 From: Daniel Avila Date: Tue, 28 Mar 2023 19:10:22 -0400 Subject: [PATCH] chore: add back clear convo dialog --- client/src/components/Nav/ClearConvos.jsx | 33 ++++++++++++++++------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/client/src/components/Nav/ClearConvos.jsx b/client/src/components/Nav/ClearConvos.jsx index e975c79e5e..3cf6291c48 100644 --- a/client/src/components/Nav/ClearConvos.jsx +++ b/client/src/components/Nav/ClearConvos.jsx @@ -1,9 +1,10 @@ import React from 'react'; +import store from '~/store'; import TrashIcon from '../svg/TrashIcon'; import { useSWRConfig } from 'swr'; import manualSWR from '~/utils/fetchers'; - -import store from '~/store'; +import { Dialog, DialogTrigger } from '../ui/Dialog.tsx'; +import DialogTemplate from '../ui/DialogTemplate'; export default function ClearConvos() { const { newConversation } = store.useConversation(); @@ -13,6 +14,7 @@ export default function ClearConvos() { const { trigger } = manualSWR(`/api/convos/clear`, 'post', () => { newConversation(); refreshConversations(); + mutate(`/api/convos`); }); const clickHandler = () => { @@ -21,12 +23,25 @@ export default function ClearConvos() { }; return ( - - - Clear conversations - + + + + + Clear conversations + + + + ); }