From 0a3738a7789e3ecb759974255b6c33d5490d5cb7 Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Sun, 26 Apr 2026 12:27:24 -0500 Subject: [PATCH] =?UTF-8?q?chore:=20fix=20lint=20issues=20=E2=80=94=20move?= =?UTF-8?q?=20OAuth=20callback=20to=20lazy=20init,=20remove=20unused=20esl?= =?UTF-8?q?int-disable=20directives?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/profile/settings-accounts-tab.tsx | 19 +++++++++++-------- components/profile/settings-security-tab.tsx | 1 - 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/components/profile/settings-accounts-tab.tsx b/components/profile/settings-accounts-tab.tsx index 1e73c3a..1dd4b66 100644 --- a/components/profile/settings-accounts-tab.tsx +++ b/components/profile/settings-accounts-tab.tsx @@ -40,17 +40,20 @@ export function SettingsAccountsTab({ authMethods, isLoadingAuthMethods, onRefre const [isLoadingAccounts, setIsLoadingAccounts] = useState(true) const [accountsError, setAccountsError] = useState(null) const [unlinking, setUnlinking] = useState(null) - const [message, setMessage] = useState<{ type: "success" | "error"; text: string } | null>(null) + const [message, setMessage] = useState<{ type: "success" | "error"; text: string } | null>(() => { + // Check for OAuth callback success on initial render + if (typeof window !== "undefined") { + const params = new URLSearchParams(window.location.search) + if (params.has("linked")) { + window.history.replaceState({}, "", window.location.pathname) + return { type: "success", text: "Account linked successfully!" } + } + } + return null + }) useEffect(() => { fetchAccounts() - // Check for OAuth callback success - const params = new URLSearchParams(window.location.search) - if (params.has("linked")) { - setMessage({ type: "success", text: "Account linked successfully!" }) - window.history.replaceState({}, "", window.location.pathname) - } - // eslint-disable-next-line react-hooks/exhaustive-deps }, []) async function fetchAccounts() { diff --git a/components/profile/settings-security-tab.tsx b/components/profile/settings-security-tab.tsx index 8f0d163..f35d8f8 100644 --- a/components/profile/settings-security-tab.tsx +++ b/components/profile/settings-security-tab.tsx @@ -47,7 +47,6 @@ export function SettingsSecurityTab({ authMethods, isLoadingAuthMethods, onRefre useEffect(() => { fetchPasskeys() - // eslint-disable-next-line react-hooks/exhaustive-deps }, []) async function fetchPasskeys() {