Skip to content

Commit 3f53ef2

Browse files
committed
refactor: rename handleAddSubscription to addSubscription
1 parent f919f89 commit 3f53ef2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

apps/xen-tg-app/src/components/NewsSource.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const NewSubscription: FC<{ onClose: () => void }> = ({ onClose }) => {
4343
const [newLink, setNewLink] = useState('')
4444
const [showWrongSubscriptionNameMessage, setShowWrongSubscriptionNameMessage] = useState(false)
4545
const queryClient = useQueryClient()
46-
const handleAddSubscription = useMutation({
46+
const addSubscription = useMutation({
4747
mutationFn,
4848
onSuccess: () => {
4949
queryClient.invalidateQueries({ queryKey: ['subscriptions'] }).then(onClose)
@@ -59,7 +59,7 @@ export const NewSubscription: FC<{ onClose: () => void }> = ({ onClose }) => {
5959
if (!isValidated) {
6060
setShowWrongSubscriptionNameMessage(true)
6161
} else {
62-
handleAddSubscription.mutate({
62+
addSubscription.mutate({
6363
methodName: 'addSubscription',
6464
params: {
6565
source: 'reddit', // ToDo: hardcoded
@@ -92,11 +92,11 @@ export const NewSubscription: FC<{ onClose: () => void }> = ({ onClose }) => {
9292
className={`flex h-8 w-15 shrink-0 cursor-pointer items-center justify-center gap-1 rounded-[10px] bg-(--color-green) text-xs/[100%] font-normal text-(--color-opposite-text) capitalize dark:bg-(--color-main-text) dark:text-(--color-opposite-text)`}
9393
disabled={
9494
showWrongSubscriptionNameMessage ||
95-
handleAddSubscription.isPending ||
96-
handleAddSubscription.isSuccess
95+
addSubscription.isPending ||
96+
addSubscription.isSuccess
9797
}
9898
>
99-
{handleAddSubscription.isPending || handleAddSubscription.isSuccess ? (
99+
{addSubscription.isPending || addSubscription.isSuccess ? (
100100
<Spinner />
101101
) : (
102102
<>
@@ -109,8 +109,8 @@ export const NewSubscription: FC<{ onClose: () => void }> = ({ onClose }) => {
109109
className="mr-1 flex cursor-pointer p-1.5 text-[#7A818B] transition hover:not-disabled:text-(--color-main-text)"
110110
disabled={
111111
showWrongSubscriptionNameMessage ||
112-
handleAddSubscription.isPending ||
113-
handleAddSubscription.isSuccess
112+
addSubscription.isPending ||
113+
addSubscription.isSuccess
114114
}
115115
onClick={() => {
116116
setNewLink('')

0 commit comments

Comments
 (0)