Fix login button — useRef for input, window.location redirect. Add logout to settings.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user