chore: fix lint issues — move OAuth callback to lazy init, remove unused eslint-disable directives

This commit is contained in:
2026-04-26 12:27:24 -05:00
parent 36323f3ba3
commit 0a3738a778
2 changed files with 11 additions and 9 deletions
+11 -8
View File
@@ -40,17 +40,20 @@ export function SettingsAccountsTab({ authMethods, isLoadingAuthMethods, onRefre
const [isLoadingAccounts, setIsLoadingAccounts] = useState(true)
const [accountsError, setAccountsError] = useState<string | null>(null)
const [unlinking, setUnlinking] = useState<string | null>(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() {