1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

544 migrate to react query v4 (#547)

* Update all imports

* Update isLoading

* Update onlineManager
This commit is contained in:
xmflsct
2022-12-10 14:47:19 +01:00
committed by GitHub
parent b449d50b78
commit 357c4039cb
48 changed files with 296 additions and 431 deletions

View File

@ -17,7 +17,7 @@ import { uniqBy } from 'lodash'
import React, { useCallback, useContext, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { Pressable, StyleSheet, View } from 'react-native'
import { useQueryClient } from 'react-query'
import { useQueryClient } from '@tanstack/react-query'
import { useSelector } from 'react-redux'
import StatusContext from './Context'

View File

@ -8,7 +8,7 @@ import { useTheme } from '@utils/styles/ThemeManager'
import React, { useContext } from 'react'
import { useTranslation } from 'react-i18next'
import { Pressable, View } from 'react-native'
import { useQueryClient } from 'react-query'
import { useQueryClient } from '@tanstack/react-query'
import StatusContext from './Context'
import HeaderSharedCreated from './HeaderShared/Created'
import HeaderSharedMuted from './HeaderShared/Muted'

View File

@ -16,7 +16,7 @@ import { maxBy } from 'lodash'
import React, { useCallback, useContext, useMemo, useState } from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { Pressable, View } from 'react-native'
import { useQueryClient } from 'react-query'
import { useQueryClient } from '@tanstack/react-query'
import StatusContext from './Context'
const TimelinePoll: React.FC = () => {

View File

@ -56,7 +56,7 @@ const TimelineTranslate = () => {
: settingsLanguage || Localization.locale || 'en'
const [enabled, setEnabled] = useState(false)
const { refetch, data, isLoading, isSuccess, isError } = useTranslateQuery({
const { refetch, data, isFetching, isSuccess, isError } = useTranslateQuery({
source: detectedLanguage.language,
target: targetLanguage,
text,
@ -111,7 +111,7 @@ const TimelineTranslate = () => {
<CustomText
fontStyle='M'
style={{
color: isLoading || isSuccess ? colors.secondary : isError ? colors.red : colors.blue
color: isFetching || isSuccess ? colors.secondary : isError ? colors.red : colors.blue
}}
>
{isError
@ -125,7 +125,7 @@ const TimelineTranslate = () => {
})
: t('shared.translate.default')}
</CustomText>
{isLoading ? (
{isFetching ? (
<Circle
size={StyleConstants.Font.Size.M}
color={colors.disabled}