Fix login button — useRef for input, window.location redirect. Add logout to settings.

This commit is contained in:
2026-04-26 11:56:09 -04:00
parent 3681eec9eb
commit 315a91e943
2 changed files with 30 additions and 37 deletions
+6 -1
View File
@@ -2,7 +2,7 @@
import { useEffect, useState } from 'react';
import { useStore } from '@/lib/store';
import { api } from '@/lib/api';
import { api, auth } from '@/lib/api';
import type { Status } from '@/lib/api';
export default function SettingsPanel() {
@@ -50,6 +50,11 @@ export default function SettingsPanel() {
a.click();
}
async function logout() {
await auth.logout();
window.location.href = '/login';
}
async function clearAll() {
if (!confirm('Delete all conversations permanently?')) return;
await api.clearAllConversations();