From 006d91eedd7ce475ce98963163c09ab53afa1a29 Mon Sep 17 00:00:00 2001 From: Aidan Date: Wed, 16 Apr 2025 17:36:59 -0400 Subject: [PATCH] hf: lint fixes --- app/api/captcha/create/route.ts | 2 +- .../cards/dashboard/Settings/ChangeAuthentikPassword.tsx | 8 ++++---- .../cards/dashboard/Settings/ChangeEmailPassword.tsx | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/api/captcha/create/route.ts b/app/api/captcha/create/route.ts index a5b8ae8..f552970 100644 --- a/app/api/captcha/create/route.ts +++ b/app/api/captcha/create/route.ts @@ -17,6 +17,6 @@ async function getChallenge() { return NextResponse.json(challenge) } -export async function GET(request: Request) { +export async function GET() { return getChallenge() } \ No newline at end of file diff --git a/components/cards/dashboard/Settings/ChangeAuthentikPassword.tsx b/components/cards/dashboard/Settings/ChangeAuthentikPassword.tsx index 59c2fe7..c43dd2b 100644 --- a/components/cards/dashboard/Settings/ChangeAuthentikPassword.tsx +++ b/components/cards/dashboard/Settings/ChangeAuthentikPassword.tsx @@ -1,6 +1,6 @@ "use client" -import React, { useState, useRef, useEffect } from "react" +import React, { useState, useRef, useEffect, useCallback } from "react" import { Input } from "@/components/ui/input" import { Button } from "@/components/ui/button" import { Label } from "@/components/ui/label" @@ -139,7 +139,7 @@ export function ChangeAuthentikPassword() { }, 1000) } - const handleHoldEnd = () => { + const handleHoldEnd = useCallback(() => { if (holdTimeoutRef.current) { clearTimeout(holdTimeoutRef.current) holdTimeoutRef.current = null @@ -154,7 +154,7 @@ export function ChangeAuthentikPassword() { intervalRef.current = null } } - } + }, [isHolding, controls]) useEffect(() => { return () => { @@ -173,7 +173,7 @@ export function ChangeAuthentikPassword() { setLoading(false) setNewPassword("") } - }, [open]) + }, [open, handleHoldEnd]) return ( diff --git a/components/cards/dashboard/Settings/ChangeEmailPassword.tsx b/components/cards/dashboard/Settings/ChangeEmailPassword.tsx index ebe7dac..d32fa5a 100644 --- a/components/cards/dashboard/Settings/ChangeEmailPassword.tsx +++ b/components/cards/dashboard/Settings/ChangeEmailPassword.tsx @@ -1,6 +1,6 @@ "use client" -import React, { useState, useRef, useEffect } from "react" +import React, { useState, useRef, useEffect, useCallback } from "react" import { Input } from "@/components/ui/input" import { Button } from "@/components/ui/button" import { Label } from "@/components/ui/label" @@ -139,7 +139,7 @@ export function ChangeEmailPassword() { }, 1000) } - const handleHoldEnd = () => { + const handleHoldEnd = useCallback(() => { if (holdTimeoutRef.current) { clearTimeout(holdTimeoutRef.current) holdTimeoutRef.current = null @@ -154,7 +154,7 @@ export function ChangeEmailPassword() { intervalRef.current = null } } - } + }, [isHolding, controls]) useEffect(() => { return () => { @@ -173,7 +173,7 @@ export function ChangeEmailPassword() { setLoading(false) setNewPassword("") } - }, [open]) + }, [open, handleHoldEnd]) return (