fix: clean up dashboard upload state
- Prevent object URL leaks in image-classification-form by revoking previous preview URL before replacing it, revoking after successful submit, and revoking on component unmount - Improve preview image alt text from generic "Preview" to descriptive Indonesian text "Pratinjau gambar daun jagung untuk diagnosis" - Use auth store setter consistently in dashboard-page logout instead of direct setState call Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
1b5c16b135
commit
7fb8b075b8
@@ -12,6 +12,7 @@ import { apiClient } from '@/lib/api-client';
|
||||
|
||||
export function DashboardPage() {
|
||||
const { user } = useAuthStore();
|
||||
const setUser = useAuthStore((state) => state.setUser);
|
||||
const { dashboardCompact, toggleDashboardCompact } = useUiStore();
|
||||
const queryClient = useQueryClient();
|
||||
const navigate = useNavigate();
|
||||
@@ -62,7 +63,7 @@ export function DashboardPage() {
|
||||
await apiClient.logout();
|
||||
},
|
||||
onSuccess: () => {
|
||||
useAuthStore.setState({ user: null });
|
||||
setUser(null);
|
||||
queryClient.clear();
|
||||
navigate('/login');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user