fix: resolve ESLint errors in login and settings pages (CI failure)
- login/page.tsx: remove unused _setUser binding and useAuthStore import
- login/page.tsx: replace unused _err catch binding with bare catch {}
- settings/page.tsx: remove useEffect calling setProfileForm synchronously
(react-hooks/set-state-in-effect error); form already initialised from
user in useState so the effect was redundant
- npm run lint now exits 0 with no errors or warnings
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/pop_puller_to_gmail/sessions/5140cd73-e2f0-41a8-ad3e-267d82d3700b
This commit is contained in:
@@ -4,11 +4,9 @@ import { useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
import { authApi } from '@/lib/api';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
|
||||
export default function LoginPage() {
|
||||
const router = useRouter();
|
||||
const _setUser = useAuthStore((state) => state.setUser);
|
||||
const [email, setEmail] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [error, setError] = useState('');
|
||||
@@ -38,7 +36,7 @@ export default function LoginPage() {
|
||||
const redirectUri = `${window.location.origin}/auth/callback`;
|
||||
const authUrl = await authApi.getGoogleAuthUrl(redirectUri);
|
||||
window.location.href = authUrl;
|
||||
} catch (_err: unknown) {
|
||||
} catch {
|
||||
setError('Failed to initialize Google login');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { AuthGuard } from '@/components/AuthGuard';
|
||||
import { DashboardLayout } from '@/components/DashboardLayout';
|
||||
@@ -35,16 +35,6 @@ function SettingsContent() {
|
||||
initialData: user ?? undefined,
|
||||
});
|
||||
|
||||
// Sync form when server data arrives
|
||||
useEffect(() => {
|
||||
if (currentUser) {
|
||||
setProfileForm({
|
||||
full_name: currentUser.full_name || '',
|
||||
email: currentUser.email || '',
|
||||
});
|
||||
}
|
||||
}, [currentUser]);
|
||||
|
||||
const updateProfileMutation = useMutation({
|
||||
mutationFn: (data: { full_name: string; email: string }) =>
|
||||
userApi.updateProfile(data),
|
||||
|
||||
Reference in New Issue
Block a user