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:
Asep Haryana Saputra
2026-05-22 17:07:18 +00:00
co-authored by Claude Opus 4.7
parent 1b5c16b135
commit 7fb8b075b8
2 changed files with 25 additions and 3 deletions
+2 -1
View File
@@ -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');
},