From 9928b89c8f649bc8e30783cf267753e01a6084c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 18 Aug 2024 17:54:52 +0200 Subject: [PATCH] wow there are no type errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/queries/accounts.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/queries/accounts.ts b/src/queries/accounts.ts index 60cba117e..1d9a979d9 100644 --- a/src/queries/accounts.ts +++ b/src/queries/accounts.ts @@ -1,7 +1,7 @@ import { useMutation } from '@tanstack/react-query'; import { patchMeSuccess } from 'soapbox/actions/me'; -import { useAppDispatch, useClient, useOwnAccount } from 'soapbox/hooks'; +import { useAppDispatch, useClient } from 'soapbox/hooks'; import toast from 'soapbox/toast'; type IAccount = { @@ -33,18 +33,19 @@ type UpdateCredentialsData = { } const useUpdateCredentials = () => { - const { account } = useOwnAccount(); + // const { account } = useOwnAccount(); const client = useClient(); const dispatch = useAppDispatch(); return useMutation({ mutationFn: (data: UpdateCredentialsData) => client.settings.updateCredentials(data), - onMutate(variables) { - const cachedAccount = account; - dispatch(patchMeSuccess({ ...account, ...variables })); + // TODO: What is it intended to do? + // onMutate(variables) { + // const cachedAccount = account; + // dispatch(patchMeSuccess({ ...account, ...variables })); - return { cachedAccount }; - }, + // return { cachedAccount }; + // }, onSuccess(response) { dispatch(patchMeSuccess(response)); toast.success('Chat Settings updated successfully');