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:
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
- Fixed three ESLint errors that caused CI to fail: removed unused `_setUser` store binding and unused `useAuthStore` import from `login/page.tsx`; replaced unused `_err` catch binding with a bare `catch {}` in `login/page.tsx`; removed a `useEffect` in `settings/page.tsx` that called `setProfileForm` synchronously (flagged by `react-hooks/set-state-in-effect`) — the effect was redundant because `useState` already initialises the form from the auth store's `user` object, which is the same value passed as `initialData` to `useQuery`.
|
||||
- Fixed wizard to create new mail accounts showing a big grey screen: `bg-opacity-75` was removed in Tailwind CSS v4; replaced with the `/75` opacity modifier syntax (`bg-gray-500/75`) in `AddMailAccountModal` and `DashboardLayout` mobile overlay. Restructured the modal from the deprecated `inline-block align-bottom` centering trick to a proper flexbox layout with `relative z-10` on the modal content.
|
||||
- Fixed mail account creation always failing with a backend validation error: `email_address` and `forward_to` are required fields in the backend schema but were missing from the `AddMailAccountModal` form. Added both fields to the form — `email_address` is auto-synced from the username input, and `forward_to` (destination Gmail address) is a new explicit field pre-populated from the logged-in user's email. Also added `delivery_method` selector and `delete_after_forward` checkbox.
|
||||
- Implemented the Settings page (was a placeholder showing "coming soon"): now includes a Profile section to update name and email via `PUT /users/me`, an Account Information section showing subscription tier/status and member-since date, and a Security section.
|
||||
|
||||
@@ -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