mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix: move useState before useMutation for consistent hook ordering
This commit is contained in:
@@ -41,6 +41,8 @@ export default function ConnectedAccounts() {
|
|||||||
const { showToast } = useToast();
|
const { showToast } = useToast();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
|
const [confirmingUnlink, setConfirmingUnlink] = useState<string | null>(null);
|
||||||
|
|
||||||
const { data, isLoading, isError } = useQuery({
|
const { data, isLoading, isError } = useQuery({
|
||||||
queryKey: ['linked-providers'],
|
queryKey: ['linked-providers'],
|
||||||
queryFn: () => authApi.getLinkedProviders(),
|
queryFn: () => authApi.getLinkedProviders(),
|
||||||
@@ -87,8 +89,6 @@ export default function ConnectedAccounts() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const [confirmingUnlink, setConfirmingUnlink] = useState<string | null>(null);
|
|
||||||
|
|
||||||
const handleUnlink = (provider: string) => {
|
const handleUnlink = (provider: string) => {
|
||||||
if (confirmingUnlink === provider) {
|
if (confirmingUnlink === provider) {
|
||||||
setConfirmingUnlink(null);
|
setConfirmingUnlink(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user