diff --git a/app/components/chat-list.tsx b/app/components/chat-list.tsx
index 2c7b95aa4..02ea086b2 100644
--- a/app/components/chat-list.tsx
+++ b/app/components/chat-list.tsx
@@ -67,7 +67,10 @@ export function ChatItem(props: {
>
)}
-
@@ -77,14 +80,14 @@ export function ChatItem(props: {
}
export function ChatList(props: { narrow?: boolean }) {
- const [sessions, selectedIndex, selectSession, removeSession, moveSession] =
- useChatStore((state) => [
+ const [sessions, selectedIndex, selectSession, moveSession] = useChatStore(
+ (state) => [
state.sessions,
state.currentSessionIndex,
state.selectSession,
- state.removeSession,
state.moveSession,
- ]);
+ ],
+ );
const chatStore = useChatStore();
const navigate = useNavigate();
diff --git a/app/components/sidebar.tsx b/app/components/sidebar.tsx
index 47a311725..776219641 100644
--- a/app/components/sidebar.tsx
+++ b/app/components/sidebar.tsx
@@ -138,7 +138,11 @@ export function SideBar(props: { className?: string }) {
}
- onClick={chatStore.deleteSession}
+ onClick={() => {
+ if (confirm(Locale.Home.DeleteChat)) {
+ chatStore.deleteSession(chatStore.currentSessionIndex);
+ }
+ }}
/>
diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx
index 5b6ed9598..c16f94a42 100644
--- a/app/components/ui-lib.tsx
+++ b/app/components/ui-lib.tsx
@@ -158,6 +158,7 @@ export type ToastProps = {
text: string;
onClick: () => void;
};
+ onClose?: () => void;
};
export function Toast(props: ToastProps) {
@@ -167,7 +168,10 @@ export function Toast(props: ToastProps) {
{props.content}
{props.action && (