fix: resolve 3 lint issues

- login-form.tsx: suppress unused-vars warning for emailChecked state
- bookmark-button.tsx: use function initializer for isLoading to avoid sync setState in effect
- saved-games.ts: remove unused 'set' parameter from check endpoint
This commit is contained in:
2026-04-27 13:15:16 +08:00
parent 10fdbe9cee
commit 457d6f5f39
3 changed files with 4 additions and 6 deletions
+1
View File
@@ -42,6 +42,7 @@ export default function LoginForm() {
const [password, setPassword] = useState("") const [password, setPassword] = useState("")
const [error, setError] = useState("") const [error, setError] = useState("")
const [isLoading, setIsLoading] = useState(false) const [isLoading, setIsLoading] = useState(false)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [emailChecked, setEmailChecked] = useState(false) const [emailChecked, setEmailChecked] = useState(false)
const mountedRef = useRef(true) const mountedRef = useRef(true)
const passkeyInitiatedRef = useRef(false) const passkeyInitiatedRef = useRef(false)
+2 -5
View File
@@ -13,14 +13,11 @@ interface BookmarkButtonProps {
export function BookmarkButton({ gameId, className = "" }: BookmarkButtonProps) { export function BookmarkButton({ gameId, className = "" }: BookmarkButtonProps) {
const { data: session } = useSession() const { data: session } = useSession()
const [isSaved, setIsSaved] = useState(false) const [isSaved, setIsSaved] = useState(false)
const [isLoading, setIsLoading] = useState(true) const [isLoading, setIsLoading] = useState(() => !session)
const [isToggling, setIsToggling] = useState(false) const [isToggling, setIsToggling] = useState(false)
useEffect(() => { useEffect(() => {
if (!session) { if (!session) return
setIsLoading(false)
return
}
async function checkSaved() { async function checkSaved() {
try { try {
+1 -1
View File
@@ -132,7 +132,7 @@ export const savedGamesRoutes = new Elysia({ prefix: "/user/me/saved-games" })
) )
.get( .get(
"/check/:gameId", "/check/:gameId",
async ({ request, params, set }) => { async ({ request, params }) => {
const session = await auth.api.getSession({ const session = await auth.api.getSession({
headers: request.headers, headers: request.headers,
}) })