From b449d50b78c3ecfebb3245754c723fc28d9afe18 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sat, 10 Dec 2022 13:38:26 +0100 Subject: [PATCH 1/9] Fix push server key data staled --- src/screens/Tabs/Me/Push.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/screens/Tabs/Me/Push.tsx b/src/screens/Tabs/Me/Push.tsx index fd37f3ca..8c549f2e 100644 --- a/src/screens/Tabs/Me/Push.tsx +++ b/src/screens/Tabs/Me/Push.tsx @@ -35,12 +35,7 @@ const TabMePush: React.FC = () => { const instance = useSelector(getInstance) const expoToken = useSelector(getExpoToken) - const [serverKeyAvailable, setServerKeyAvailable] = useState() - useAppsQuery({ - options: { - onSuccess: data => setServerKeyAvailable(!!data.vapid_key) - } - }) + const appsQuery = useAppsQuery() const dispatch = useAppDispatch() const instancePush = useSelector(getInstancePush) @@ -66,7 +61,7 @@ const TabMePush: React.FC = () => { } } - if (serverKeyAvailable) { + if (appsQuery.data?.vapid_key) { checkPush() if (isDevelopment) { @@ -80,7 +75,7 @@ const TabMePush: React.FC = () => { return () => { subscription.remove() } - }, [serverKeyAvailable]) + }, [appsQuery.data?.vapid_key]) const alerts = () => instancePush?.alerts @@ -133,7 +128,7 @@ const TabMePush: React.FC = () => { return ( - {!!serverKeyAvailable ? ( + {!!appsQuery.data?.vapid_key ? ( <> {!!pushAvailable ? ( <> From 357c4039cbce6c3fea5e364ae8d7f02cb040529e Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sat, 10 Dec 2022 14:47:19 +0100 Subject: [PATCH 2/9] 544 migrate to react query v4 (#547) * Update all imports * Update isLoading * Update onlineManager --- package.json | 2 +- src/App.tsx | 2 +- src/components/Relationship/Incoming.tsx | 2 +- src/components/Relationship/Outgoing.tsx | 2 +- src/components/Timeline/Conversation.tsx | 2 +- src/components/Timeline/Refresh.tsx | 2 +- src/components/Timeline/Shared/Actions.tsx | 2 +- .../Timeline/Shared/HeaderConversation.tsx | 2 +- src/components/Timeline/Shared/Poll.tsx | 2 +- src/components/Timeline/Shared/Translate.tsx | 6 +- src/components/contextMenu/account.ts | 2 +- src/components/contextMenu/instance.ts | 2 +- src/components/contextMenu/status.ts | 2 +- src/helpers/queryClient.ts | 2 +- src/screens/Actions/NotificationsFilter.tsx | 2 +- src/screens/Compose.tsx | 2 +- src/screens/Compose/utils/processText.tsx | 2 - src/screens/Tabs/Me/List/Edit.tsx | 2 +- src/screens/Tabs/Me/List/index.tsx | 2 +- src/screens/Tabs/Me/List/menus.tsx | 2 +- src/screens/Tabs/Me/Profile/Root.tsx | 16 +- .../Tabs/Me/Profile/Root/AvatarHeader.tsx | 7 +- src/screens/Tabs/Me/Root/Logout.tsx | 2 +- src/screens/Tabs/Shared/Account.tsx | 2 +- src/screens/Tabs/Shared/Search/Empty.tsx | 6 +- src/screens/Tabs/Shared/Search/index.tsx | 4 +- src/screens/Tabs/Shared/Toot.tsx | 2 +- src/startup/netInfo.ts | 4 +- src/utils/queryHooks/account.ts | 16 +- src/utils/queryHooks/announcement.ts | 9 +- src/utils/queryHooks/apps.ts | 2 +- src/utils/queryHooks/emojis.ts | 2 +- src/utils/queryHooks/instance.ts | 2 +- src/utils/queryHooks/lists.ts | 2 +- src/utils/queryHooks/profile.ts | 2 +- src/utils/queryHooks/relationship.ts | 9 +- src/utils/queryHooks/search.ts | 2 +- src/utils/queryHooks/status.ts | 9 +- src/utils/queryHooks/statusesHistory.ts | 2 +- src/utils/queryHooks/tags.ts | 7 +- src/utils/queryHooks/timeline.ts | 2 +- src/utils/queryHooks/timeline/deleteItem.ts | 2 +- src/utils/queryHooks/timeline/editItem.ts | 2 +- .../timeline/updateStatusProperty.ts | 2 +- src/utils/queryHooks/translate.ts | 2 +- src/utils/queryHooks/trends.ts | 2 +- src/utils/queryHooks/users.ts | 2 +- yarn.lock | 562 +++++++----------- 48 files changed, 296 insertions(+), 431 deletions(-) diff --git a/package.json b/package.json index 42c4ade9..ec53b8dc 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "@reduxjs/toolkit": "^1.9.1", "@sentry/react-native": "4.10.1", "@sharcoux/slider": "^6.1.1", + "@tanstack/react-query": "^4.19.1", "axios": "^0.27.2", "expo": "^47.0.8", "expo-auth-session": "^3.7.3", @@ -89,7 +90,6 @@ "react-native-svg": "^13.6.0", "react-native-swipe-list-view": "^3.2.9", "react-native-tab-view": "^3.3.2", - "react-query": "^3.39.2", "react-redux": "^8.0.5", "redux-persist": "^6.0.0", "rn-placeholder": "^3.0.3", diff --git a/src/App.tsx b/src/App.tsx index 92dcc448..5d77d55a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,7 +23,7 @@ import { LogBox, Platform } from 'react-native' import { GestureHandlerRootView } from 'react-native-gesture-handler' import { SafeAreaProvider } from 'react-native-safe-area-context' import { enableFreeze } from 'react-native-screens' -import { QueryClientProvider } from 'react-query' +import { QueryClientProvider } from '@tanstack/react-query' import { Provider } from 'react-redux' import { PersistGate } from 'redux-persist/integration/react' diff --git a/src/components/Relationship/Incoming.tsx b/src/components/Relationship/Incoming.tsx index d6eb633c..837345f6 100644 --- a/src/components/Relationship/Incoming.tsx +++ b/src/components/Relationship/Incoming.tsx @@ -8,7 +8,7 @@ import { useTheme } from '@utils/styles/ThemeManager' import React from 'react' import { useTranslation } from 'react-i18next' import { StyleSheet, View } from 'react-native' -import { useQueryClient } from 'react-query' +import { useQueryClient } from '@tanstack/react-query' export interface Props { id: Mastodon.Account['id'] diff --git a/src/components/Relationship/Outgoing.tsx b/src/components/Relationship/Outgoing.tsx index b551d670..f41ea157 100644 --- a/src/components/Relationship/Outgoing.tsx +++ b/src/components/Relationship/Outgoing.tsx @@ -10,7 +10,7 @@ import { QueryKeyTimeline } from '@utils/queryHooks/timeline' import { useTheme } from '@utils/styles/ThemeManager' import React from 'react' import { useTranslation } from 'react-i18next' -import { useQueryClient } from 'react-query' +import { useQueryClient } from '@tanstack/react-query' export interface Props { id: Mastodon.Account['id'] diff --git a/src/components/Timeline/Conversation.tsx b/src/components/Timeline/Conversation.tsx index b3311a28..8e07d2c0 100644 --- a/src/components/Timeline/Conversation.tsx +++ b/src/components/Timeline/Conversation.tsx @@ -8,7 +8,7 @@ import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import React, { useCallback } from 'react' import { Pressable, View } from 'react-native' -import { useMutation, useQueryClient } from 'react-query' +import { useMutation, useQueryClient } from '@tanstack/react-query' import TimelineActions from './Shared/Actions' import TimelineContent from './Shared/Content' import StatusContext from './Shared/Context' diff --git a/src/components/Timeline/Refresh.tsx b/src/components/Timeline/Refresh.tsx index 38cfdcdd..8ddfd52f 100644 --- a/src/components/Timeline/Refresh.tsx +++ b/src/components/Timeline/Refresh.tsx @@ -20,7 +20,7 @@ import Animated, { useSharedValue, withTiming } from 'react-native-reanimated' -import { InfiniteData, useQueryClient } from 'react-query' +import { InfiniteData, useQueryClient } from '@tanstack/react-query' export interface Props { flRef: RefObject> diff --git a/src/components/Timeline/Shared/Actions.tsx b/src/components/Timeline/Shared/Actions.tsx index 0991ee89..a803dd45 100644 --- a/src/components/Timeline/Shared/Actions.tsx +++ b/src/components/Timeline/Shared/Actions.tsx @@ -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' diff --git a/src/components/Timeline/Shared/HeaderConversation.tsx b/src/components/Timeline/Shared/HeaderConversation.tsx index baa255d7..51dbb870 100644 --- a/src/components/Timeline/Shared/HeaderConversation.tsx +++ b/src/components/Timeline/Shared/HeaderConversation.tsx @@ -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' diff --git a/src/components/Timeline/Shared/Poll.tsx b/src/components/Timeline/Shared/Poll.tsx index 6a21fcae..933d3da9 100644 --- a/src/components/Timeline/Shared/Poll.tsx +++ b/src/components/Timeline/Shared/Poll.tsx @@ -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 = () => { diff --git a/src/components/Timeline/Shared/Translate.tsx b/src/components/Timeline/Shared/Translate.tsx index cdbd66b9..d55369dd 100644 --- a/src/components/Timeline/Shared/Translate.tsx +++ b/src/components/Timeline/Shared/Translate.tsx @@ -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 = () => { {isError @@ -125,7 +125,7 @@ const TimelineTranslate = () => { }) : t('shared.translate.default')} - {isLoading ? ( + {isFetching ? ( content: string - refetch?: (options?: FetchOptions | undefined) => Promise disableDebounce?: boolean } diff --git a/src/screens/Tabs/Me/List/Edit.tsx b/src/screens/Tabs/Me/List/Edit.tsx index 70635d53..5666fb63 100644 --- a/src/screens/Tabs/Me/List/Edit.tsx +++ b/src/screens/Tabs/Me/List/Edit.tsx @@ -13,7 +13,7 @@ import { useTheme } from '@utils/styles/ThemeManager' import React, { useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { Alert, Platform, ScrollView, TextInput } from 'react-native' -import { useQueryClient } from 'react-query' +import { useQueryClient } from '@tanstack/react-query' const TabMeListEdit: React.FC> = ({ navigation, diff --git a/src/screens/Tabs/Me/List/index.tsx b/src/screens/Tabs/Me/List/index.tsx index 2ec2c3e1..9f302971 100644 --- a/src/screens/Tabs/Me/List/index.tsx +++ b/src/screens/Tabs/Me/List/index.tsx @@ -9,7 +9,7 @@ import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import React, { useEffect } from 'react' import { useTranslation } from 'react-i18next' -import { useQueryClient } from 'react-query' +import { useQueryClient } from '@tanstack/react-query' import * as DropdownMenu from 'zeego/dropdown-menu' import { menuListAccounts, menuListDelete, menuListEdit } from './menus' diff --git a/src/screens/Tabs/Me/List/menus.tsx b/src/screens/Tabs/Me/List/menus.tsx index aaccaf6b..223a56e1 100644 --- a/src/screens/Tabs/Me/List/menus.tsx +++ b/src/screens/Tabs/Me/List/menus.tsx @@ -1,7 +1,7 @@ import navigationRef from '@helpers/navigationRef' import i18next from 'i18next' import { Alert } from 'react-native' -import { UseMutationResult } from 'react-query' +import { UseMutationResult } from '@tanstack/react-query' export const menuListAccounts = ({ params }: { params: Mastodon.List }) => ({ key: 'list-accounts', diff --git a/src/screens/Tabs/Me/Profile/Root.tsx b/src/screens/Tabs/Me/Profile/Root.tsx index 6a1f4ba1..9034ba4d 100644 --- a/src/screens/Tabs/Me/Profile/Root.tsx +++ b/src/screens/Tabs/Me/Profile/Root.tsx @@ -21,7 +21,7 @@ const TabMeProfileRoot: React.FC< const { showActionSheetWithOptions } = useActionSheet() - const { data, isLoading } = useProfileQuery() + const { data, isFetching } = useProfileQuery() const { mutateAsync } = useProfileMutation() const dispatch = useAppDispatch() @@ -31,7 +31,7 @@ const TabMeProfileRoot: React.FC< { data && @@ -45,7 +45,7 @@ const TabMeProfileRoot: React.FC< { data && @@ -63,7 +63,7 @@ const TabMeProfileRoot: React.FC< }) : undefined } - loading={isLoading} + loading={isFetching} iconBack='ChevronRight' onPress={() => { navigation.navigate('Tab-Me-Profile-Fields', { @@ -80,7 +80,7 @@ const TabMeProfileRoot: React.FC< ? t(`me.profile.root.visibility.options.${data?.source.privacy}`) : undefined } - loading={isLoading} + loading={isFetching} iconBack='ChevronRight' onPress={() => showActionSheetWithOptions( @@ -138,7 +138,7 @@ const TabMeProfileRoot: React.FC< data: data?.source.sensitive === undefined ? true : !data.source.sensitive }).then(() => dispatch(updateAccountPreferences())) } - loading={isLoading} + loading={isFetching} /> @@ -158,7 +158,7 @@ const TabMeProfileRoot: React.FC< data: data?.locked === undefined ? true : !data.locked }) } - loading={isLoading} + loading={isFetching} /> diff --git a/src/screens/Tabs/Me/Profile/Root/AvatarHeader.tsx b/src/screens/Tabs/Me/Profile/Root/AvatarHeader.tsx index 363c879b..cd59591b 100644 --- a/src/screens/Tabs/Me/Profile/Root/AvatarHeader.tsx +++ b/src/screens/Tabs/Me/Profile/Root/AvatarHeader.tsx @@ -24,17 +24,14 @@ const ProfileAvatarHeader: React.FC = ({ type, messageRef }) => { { const image = await mediaSelector({ mediaType: 'photo', maximum: 1, showActionSheetWithOptions, - resize: - type === 'avatar' - ? { width: 400, height: 400 } - : { width: 1500, height: 500 } + resize: type === 'avatar' ? { width: 400, height: 400 } : { width: 1500, height: 500 } }) if (image[0].uri) { mutation.mutate({ diff --git a/src/screens/Tabs/Me/Root/Logout.tsx b/src/screens/Tabs/Me/Root/Logout.tsx index a25f7bb3..502a6387 100644 --- a/src/screens/Tabs/Me/Root/Logout.tsx +++ b/src/screens/Tabs/Me/Root/Logout.tsx @@ -7,7 +7,7 @@ import { StyleConstants } from '@utils/styles/constants' import React from 'react' import { useTranslation } from 'react-i18next' import { Alert } from 'react-native' -import { useQueryClient } from 'react-query' +import { useQueryClient } from '@tanstack/react-query' import { useSelector } from 'react-redux' const Logout: React.FC = () => { diff --git a/src/screens/Tabs/Shared/Account.tsx b/src/screens/Tabs/Shared/Account.tsx index 635fcddb..f467d351 100644 --- a/src/screens/Tabs/Shared/Account.tsx +++ b/src/screens/Tabs/Shared/Account.tsx @@ -13,7 +13,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { Text, View } from 'react-native' import { useSharedValue } from 'react-native-reanimated' -import { useIsFetching } from 'react-query' +import { useIsFetching } from '@tanstack/react-query' import * as DropdownMenu from 'zeego/dropdown-menu' import AccountAttachments from './Account/Attachments' import AccountHeader from './Account/Header' diff --git a/src/screens/Tabs/Shared/Search/Empty.tsx b/src/screens/Tabs/Shared/Search/Empty.tsx index b43d3189..ae8e50a3 100644 --- a/src/screens/Tabs/Shared/Search/Empty.tsx +++ b/src/screens/Tabs/Shared/Search/Empty.tsx @@ -10,12 +10,12 @@ import { StyleSheet, TextInput, View } from 'react-native' import { Circle } from 'react-native-animated-spinkit' export interface Props { - isLoading: boolean + isFetching: boolean inputRef: React.RefObject setSearchTerm: React.Dispatch> } -const SearchEmpty: React.FC = ({ isLoading, inputRef, setSearchTerm }) => { +const SearchEmpty: React.FC = ({ isFetching, inputRef, setSearchTerm }) => { const { colors } = useTheme() const { t } = useTranslation('screenTabs') @@ -23,7 +23,7 @@ const SearchEmpty: React.FC = ({ isLoading, inputRef, setSearchTerm }) => return ( - {isLoading ? ( + {isFetching ? ( diff --git a/src/screens/Tabs/Shared/Search/index.tsx b/src/screens/Tabs/Shared/Search/index.tsx index 2eee2d01..b080bea2 100644 --- a/src/screens/Tabs/Shared/Search/index.tsx +++ b/src/screens/Tabs/Shared/Search/index.tsx @@ -84,7 +84,7 @@ const TabSharedSearch: React.FC> hashtags: t('shared.search.sections.hashtags'), statuses: t('shared.search.sections.statuses') } - const { isLoading, data, refetch } = useSearchQuery< + const { isFetching, data, refetch } = useSearchQuery< { title: string translation: string @@ -138,7 +138,7 @@ const TabSharedSearch: React.FC> }} stickySectionHeadersEnabled ListEmptyComponent={ - + } keyboardShouldPersistTaps='always' renderSectionHeader={({ section: { translation } }) => ( diff --git a/src/screens/Tabs/Shared/Toot.tsx b/src/screens/Tabs/Shared/Toot.tsx index 196bccc5..681992f3 100644 --- a/src/screens/Tabs/Shared/Toot.tsx +++ b/src/screens/Tabs/Shared/Toot.tsx @@ -6,7 +6,7 @@ import { QueryKeyTimeline } from '@utils/queryHooks/timeline' import React, { useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { FlatList } from 'react-native' -import { InfiniteQueryObserver, useQueryClient } from 'react-query' +import { InfiniteQueryObserver, useQueryClient } from '@tanstack/react-query' const TabSharedToot: React.FC> = ({ navigation, diff --git a/src/startup/netInfo.ts b/src/startup/netInfo.ts index 9e38cac7..1cc5f1b9 100644 --- a/src/startup/netInfo.ts +++ b/src/startup/netInfo.ts @@ -3,7 +3,7 @@ import NetInfo from '@react-native-community/netinfo' import { store } from '@root/store' import removeInstance from '@utils/slices/instances/remove' import { getInstance, updateInstanceAccount } from '@utils/slices/instancesSlice' -import { onlineManager } from 'react-query' +import { onlineManager } from '@tanstack/react-query' import log from './log' const netInfo = async (): Promise<{ @@ -17,7 +17,7 @@ const netInfo = async (): Promise<{ onlineManager.setEventListener(setOnline => { return NetInfo.addEventListener(state => { - setOnline(typeof state.isConnected === 'boolean' ? state.isConnected : undefined) + setOnline(!!state.isConnected) }) }) diff --git a/src/utils/queryHooks/account.ts b/src/utils/queryHooks/account.ts index 565fa71b..ed582376 100644 --- a/src/utils/queryHooks/account.ts +++ b/src/utils/queryHooks/account.ts @@ -1,16 +1,17 @@ import apiInstance from '@api/instance' import { AxiosError } from 'axios' -import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query' +import { QueryFunctionContext, useQuery, UseQueryOptions } from '@tanstack/react-query' export type QueryKeyAccount = ['Account', { id: Mastodon.Account['id'] }] -const accountQueryFunction = ({ queryKey }: QueryFunctionContext) => { +const accountQueryFunction = async ({ queryKey }: QueryFunctionContext) => { const { id } = queryKey[1] - return apiInstance({ + const res = await apiInstance({ method: 'get', url: `accounts/${id}` - }).then(res => res.body) + }) + return res.body } const useAccountQuery = ({ @@ -27,15 +28,16 @@ const useAccountQuery = ({ export type QueryKeyAccountInLists = ['AccountInLists', { id: Mastodon.Account['id'] }] -const accountInListsQueryFunction = ({ +const accountInListsQueryFunction = async ({ queryKey }: QueryFunctionContext) => { const { id } = queryKey[1] - return apiInstance({ + const res = await apiInstance({ method: 'get', url: `accounts/${id}/lists` - }).then(res => res.body) + }) + return res.body } const useAccountInListsQuery = ({ diff --git a/src/utils/queryHooks/announcement.ts b/src/utils/queryHooks/announcement.ts index 3f003041..c484b053 100644 --- a/src/utils/queryHooks/announcement.ts +++ b/src/utils/queryHooks/announcement.ts @@ -6,16 +6,16 @@ import { UseMutationOptions, useQuery, UseQueryOptions -} from 'react-query' +} from '@tanstack/react-query' type QueryKeyAnnouncement = ['Announcements', { showAll?: boolean }] -const queryFunction = ({ +const queryFunction = async ({ queryKey }: QueryFunctionContext) => { const { showAll } = queryKey[1] - return apiInstance({ + const res = await apiInstance({ method: 'get', url: `announcements`, ...(showAll && { @@ -23,7 +23,8 @@ const queryFunction = ({ with_dismissed: 'true' } }) - }).then(res => res.body) + }) + return res.body } const useAnnouncementQuery = ({ diff --git a/src/utils/queryHooks/apps.ts b/src/utils/queryHooks/apps.ts index 51d91259..79f821c9 100644 --- a/src/utils/queryHooks/apps.ts +++ b/src/utils/queryHooks/apps.ts @@ -8,7 +8,7 @@ import { UseMutationOptions, useQuery, UseQueryOptions -} from 'react-query' +} from '@tanstack/react-query' export type QueryKeyApps = ['Apps'] diff --git a/src/utils/queryHooks/emojis.ts b/src/utils/queryHooks/emojis.ts index 891bd509..e2bf0e44 100644 --- a/src/utils/queryHooks/emojis.ts +++ b/src/utils/queryHooks/emojis.ts @@ -1,6 +1,6 @@ import apiInstance from '@api/instance' import { AxiosError } from 'axios' -import { useQuery, UseQueryOptions } from 'react-query' +import { useQuery, UseQueryOptions } from '@tanstack/react-query' type QueryKeyEmojis = ['Emojis'] diff --git a/src/utils/queryHooks/instance.ts b/src/utils/queryHooks/instance.ts index c1785683..c0351f74 100644 --- a/src/utils/queryHooks/instance.ts +++ b/src/utils/queryHooks/instance.ts @@ -1,6 +1,6 @@ import apiGeneral from '@api/general' import { AxiosError } from 'axios' -import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query' +import { QueryFunctionContext, useQuery, UseQueryOptions } from '@tanstack/react-query' export type QueryKeyInstance = ['Instance', { domain?: string }] diff --git a/src/utils/queryHooks/lists.ts b/src/utils/queryHooks/lists.ts index 0f7d7071..e23c38f1 100644 --- a/src/utils/queryHooks/lists.ts +++ b/src/utils/queryHooks/lists.ts @@ -8,7 +8,7 @@ import { UseMutationOptions, useQuery, UseQueryOptions -} from 'react-query' +} from '@tanstack/react-query' export type QueryKeyLists = ['Lists'] diff --git a/src/utils/queryHooks/profile.ts b/src/utils/queryHooks/profile.ts index e6d4dd82..527893e9 100644 --- a/src/utils/queryHooks/profile.ts +++ b/src/utils/queryHooks/profile.ts @@ -6,7 +6,7 @@ import { AxiosError } from 'axios' import i18next from 'i18next' import { RefObject } from 'react' import FlashMessage from 'react-native-flash-message' -import { useMutation, useQuery, UseQueryOptions } from 'react-query' +import { useMutation, useQuery, UseQueryOptions } from '@tanstack/react-query' type AccountWithSource = Mastodon.Account & Required> diff --git a/src/utils/queryHooks/relationship.ts b/src/utils/queryHooks/relationship.ts index 1671449e..38187026 100644 --- a/src/utils/queryHooks/relationship.ts +++ b/src/utils/queryHooks/relationship.ts @@ -6,25 +6,26 @@ import { UseMutationOptions, useQuery, UseQueryOptions -} from 'react-query' +} from '@tanstack/react-query' export type QueryKeyRelationship = [ 'Relationship', { id: Mastodon.Account['id'] } ] -const queryFunction = ({ +const queryFunction = async ({ queryKey }: QueryFunctionContext) => { const { id } = queryKey[1] - return apiInstance({ + const res = await apiInstance({ method: 'get', url: `accounts/relationships`, params: { 'id[]': id } - }).then(res => res.body) + }) + return res.body } const useRelationshipQuery = ({ diff --git a/src/utils/queryHooks/search.ts b/src/utils/queryHooks/search.ts index f15e17d2..82d9fbb8 100644 --- a/src/utils/queryHooks/search.ts +++ b/src/utils/queryHooks/search.ts @@ -1,6 +1,6 @@ import apiInstance from '@api/instance' import { AxiosError } from 'axios' -import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query' +import { QueryFunctionContext, useQuery, UseQueryOptions } from '@tanstack/react-query' export type QueryKeySearch = [ 'Search', diff --git a/src/utils/queryHooks/status.ts b/src/utils/queryHooks/status.ts index c0a2de02..48a0d40c 100644 --- a/src/utils/queryHooks/status.ts +++ b/src/utils/queryHooks/status.ts @@ -1,16 +1,17 @@ import apiInstance from '@api/instance' import { AxiosError } from 'axios' -import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query' +import { QueryFunctionContext, useQuery, UseQueryOptions } from '@tanstack/react-query' export type QueryKeyStatus = ['Status', { id: Mastodon.Status['id'] }] -const queryFunction = ({ queryKey }: QueryFunctionContext) => { +const queryFunction = async ({ queryKey }: QueryFunctionContext) => { const { id } = queryKey[1] - return apiInstance({ + const res = await apiInstance({ method: 'get', url: `statuses/${id}` - }).then(res => res.body) + }) + return res.body } const useStatusQuery = ({ diff --git a/src/utils/queryHooks/statusesHistory.ts b/src/utils/queryHooks/statusesHistory.ts index a1a3e76b..b5593f31 100644 --- a/src/utils/queryHooks/statusesHistory.ts +++ b/src/utils/queryHooks/statusesHistory.ts @@ -1,6 +1,6 @@ import apiInstance from '@api/instance' import { AxiosError } from 'axios' -import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query' +import { QueryFunctionContext, useQuery, UseQueryOptions } from '@tanstack/react-query' export type QueryKeyStatusesHistory = [ 'StatusesHistory', diff --git a/src/utils/queryHooks/tags.ts b/src/utils/queryHooks/tags.ts index d7fe37bc..76ceb3a9 100644 --- a/src/utils/queryHooks/tags.ts +++ b/src/utils/queryHooks/tags.ts @@ -6,7 +6,7 @@ import { UseMutationOptions, useQuery, UseQueryOptions -} from 'react-query' +} from '@tanstack/react-query' type QueryKeyFollowedTags = ['FollowedTags'] const useFollowedTagsQuery = ({ @@ -27,10 +27,11 @@ const useFollowedTagsQuery = ({ } type QueryKeyTags = ['Tags', { tag: string }] -const queryFunction = ({ queryKey }: QueryFunctionContext) => { +const queryFunction = async ({ queryKey }: QueryFunctionContext) => { const { tag } = queryKey[1] - return apiInstance({ method: 'get', url: `tags/${tag}` }).then(res => res.body) + const res = await apiInstance({ method: 'get', url: `tags/${tag}` }) + return res.body } const useTagsQuery = ({ options, diff --git a/src/utils/queryHooks/timeline.ts b/src/utils/queryHooks/timeline.ts index eff1113e..3c285b50 100644 --- a/src/utils/queryHooks/timeline.ts +++ b/src/utils/queryHooks/timeline.ts @@ -11,7 +11,7 @@ import { useInfiniteQuery, UseInfiniteQueryOptions, useMutation -} from 'react-query' +} from '@tanstack/react-query' import deleteItem from './timeline/deleteItem' import editItem from './timeline/editItem' import updateStatusProperty from './timeline/updateStatusProperty' diff --git a/src/utils/queryHooks/timeline/deleteItem.ts b/src/utils/queryHooks/timeline/deleteItem.ts index d2911bf8..22feaa20 100644 --- a/src/utils/queryHooks/timeline/deleteItem.ts +++ b/src/utils/queryHooks/timeline/deleteItem.ts @@ -1,5 +1,5 @@ import queryClient from '@helpers/queryClient' -import { InfiniteData } from 'react-query' +import { InfiniteData } from '@tanstack/react-query' import { MutationVarsTimelineDeleteItem } from '../timeline' const deleteItem = ({ diff --git a/src/utils/queryHooks/timeline/editItem.ts b/src/utils/queryHooks/timeline/editItem.ts index f8475e76..270887a0 100644 --- a/src/utils/queryHooks/timeline/editItem.ts +++ b/src/utils/queryHooks/timeline/editItem.ts @@ -1,5 +1,5 @@ import queryClient from '@helpers/queryClient' -import { InfiniteData } from 'react-query' +import { InfiniteData } from '@tanstack/react-query' import { MutationVarsTimelineEditItem } from '../timeline' const editItem = ({ diff --git a/src/utils/queryHooks/timeline/updateStatusProperty.ts b/src/utils/queryHooks/timeline/updateStatusProperty.ts index d0e1332f..385aac4e 100644 --- a/src/utils/queryHooks/timeline/updateStatusProperty.ts +++ b/src/utils/queryHooks/timeline/updateStatusProperty.ts @@ -1,5 +1,5 @@ import queryClient from '@helpers/queryClient' -import { InfiniteData } from 'react-query' +import { InfiniteData } from '@tanstack/react-query' import { MutationVarsTimelineUpdateStatusProperty, TimelineData } from '../timeline' import updateConversation from './update/conversation' import updateNotification from './update/notification' diff --git a/src/utils/queryHooks/translate.ts b/src/utils/queryHooks/translate.ts index 6e91c493..082015db 100644 --- a/src/utils/queryHooks/translate.ts +++ b/src/utils/queryHooks/translate.ts @@ -1,7 +1,7 @@ import apiTooot from '@api/tooot' import haptics from '@components/haptics' import { AxiosError } from 'axios' -import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query' +import { QueryFunctionContext, useQuery, UseQueryOptions } from '@tanstack/react-query' type Translations = | { diff --git a/src/utils/queryHooks/trends.ts b/src/utils/queryHooks/trends.ts index 38bcd791..e6eede21 100644 --- a/src/utils/queryHooks/trends.ts +++ b/src/utils/queryHooks/trends.ts @@ -2,7 +2,7 @@ import apiInstance from '@api/instance' import { store } from '@root/store' import { checkInstanceFeature } from '@utils/slices/instancesSlice' import { AxiosError } from 'axios' -import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query' +import { QueryFunctionContext, useQuery, UseQueryOptions } from '@tanstack/react-query' export type QueryKeyTrends = ['Trends', { type: 'tags' | 'statuses' | 'links' }] diff --git a/src/utils/queryHooks/users.ts b/src/utils/queryHooks/users.ts index 10ce5b59..75507b99 100644 --- a/src/utils/queryHooks/users.ts +++ b/src/utils/queryHooks/users.ts @@ -5,7 +5,7 @@ import { QueryFunctionContext, useInfiniteQuery, UseInfiniteQueryOptions -} from 'react-query' +} from '@tanstack/react-query' export type QueryKeyUsers = [ 'Users', diff --git a/yarn.lock b/yarn.lock index f07fdc90..325dcbf9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25,9 +25,9 @@ "@babel/highlight" "^7.18.6" "@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.0", "@babel/compat-data@^7.20.1": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.1.tgz#f2e6ef7790d8c8dbf03d379502dcc246dcce0b30" - integrity sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.5.tgz#86f172690b093373a933223b4745deeb6049e733" + integrity sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g== "@babel/core@7.9.0": version "7.9.0" @@ -51,28 +51,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.13.16", "@babel/core@^7.14.0": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.2.tgz#8dc9b1620a673f92d3624bd926dc49a52cf25b92" - integrity sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.2" - "@babel/helper-compilation-targets" "^7.20.0" - "@babel/helper-module-transforms" "^7.20.2" - "@babel/helpers" "^7.20.1" - "@babel/parser" "^7.20.2" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.1" - "@babel/types" "^7.20.2" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.1" - semver "^6.3.0" - -"@babel/core@^7.20.5": +"@babel/core@^7.13.16", "@babel/core@^7.14.0", "@babel/core@^7.20.5": version "7.20.5" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.5.tgz#45e2114dc6cd4ab167f81daf7820e8fa1250d113" integrity sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ== @@ -93,16 +72,7 @@ json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.14.0", "@babel/generator@^7.20.1", "@babel/generator@^7.20.2", "@babel/generator@^7.9.0": - version "7.20.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.4.tgz#4d9f8f0c30be75fd90a0562099a26e5839602ab8" - integrity sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA== - dependencies: - "@babel/types" "^7.20.2" - "@jridgewell/gen-mapping" "^0.3.2" - jsesc "^2.5.1" - -"@babel/generator@^7.20.5": +"@babel/generator@^7.14.0", "@babel/generator@^7.20.5", "@babel/generator@^7.9.0": version "7.20.5" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.5.tgz#cb25abee3178adf58d6814b68517c62bdbfdda95" integrity sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA== @@ -136,10 +106,10 @@ browserslist "^4.21.3" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.2.tgz#3c08a5b5417c7f07b5cf3dfb6dc79cbec682e8c2" - integrity sha512-k22GoYRAHPYr9I+Gvy2ZQlAe5mGy8BqWst2wRt8cwIufWTxrsVshhIBvYNqC80N0GSFWTsqRVexOtfzlgOEDvA== +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.2", "@babel/helper-create-class-features-plugin@^7.20.5": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.5.tgz#327154eedfb12e977baa4ecc72e5806720a85a06" + integrity sha512-3RCdA/EmEaikrhayahwToF0fpweU/8o2p8vhc1c/1kftHOdTKuC65kik/TLc+qfbS8JKw4qqJbne4ovICDhmww== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" "@babel/helper-environment-visitor" "^7.18.9" @@ -149,13 +119,13 @@ "@babel/helper-replace-supers" "^7.19.1" "@babel/helper-split-export-declaration" "^7.18.6" -"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz#7976aca61c0984202baca73d84e2337a5424a41b" - integrity sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw== +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz#5ea79b59962a09ec2acf20a963a01ab4d076ccca" + integrity sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" - regexpu-core "^5.1.0" + regexpu-core "^5.2.1" "@babel/helper-define-polyfill-provider@^0.3.3": version "0.3.3" @@ -294,25 +264,16 @@ integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== "@babel/helper-wrap-function@^7.18.9": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.19.0.tgz#89f18335cff1152373222f76a4b37799636ae8b1" - integrity sha512-txX8aN8CZyYGTwcLhlk87KRqncAzhh5TpQamZUa0/u3an36NtDpUP6bQgBCBcLeBs09R/OwQu3OjK0k/HwfNDg== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz#75e2d84d499a0ab3b31c33bcfe59d6b8a45f62e3" + integrity sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q== dependencies: "@babel/helper-function-name" "^7.19.0" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.0" - "@babel/types" "^7.19.0" + "@babel/traverse" "^7.20.5" + "@babel/types" "^7.20.5" -"@babel/helpers@^7.20.1", "@babel/helpers@^7.9.0": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.1.tgz#2ab7a0fcb0a03b5bf76629196ed63c2d7311f4c9" - integrity sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg== - dependencies: - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.1" - "@babel/types" "^7.20.0" - -"@babel/helpers@^7.20.5": +"@babel/helpers@^7.20.5", "@babel/helpers@^7.9.0": version "7.20.6" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.6.tgz#e64778046b70e04779dfbdf924e7ebb45992c763" integrity sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w== @@ -330,12 +291,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.13.16", "@babel/parser@^7.14.0", "@babel/parser@^7.18.10", "@babel/parser@^7.20.1", "@babel/parser@^7.20.2", "@babel/parser@^7.9.0": - version "7.20.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.3.tgz#5358cf62e380cf69efcb87a7bb922ff88bfac6e2" - integrity sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg== - -"@babel/parser@^7.20.5": +"@babel/parser@^7.13.16", "@babel/parser@^7.14.0", "@babel/parser@^7.18.10", "@babel/parser@^7.20.5", "@babel/parser@^7.9.0": version "7.20.5" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.5.tgz#7f3c7335fe417665d929f34ae5dceae4c04015e8" integrity sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA== @@ -384,11 +340,11 @@ "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-proposal-decorators@^7.12.9": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.20.2.tgz#1c6c32b2a44b154ebeec2bb534f9eaebdb541fb6" - integrity sha512-nkBH96IBmgKnbHQ5gXFrcmez+Z9S2EIDKDQGp005ROqBigc88Tky4rzCnlP/lnlj245dCEQl4/YyV0V1kYh5dw== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.20.5.tgz#28ba1a0e5044664a512967a19407d7fc26925394" + integrity sha512-Lac7PpRJXcC3s9cKsBfl+uc+DYXU5FD06BrTFunQO6QIQT+DwyzDPURAowI3bcvD1dZF/ank1Z5rstUJn3Hn4Q== dependencies: - "@babel/helper-create-class-features-plugin" "^7.20.2" + "@babel/helper-create-class-features-plugin" "^7.20.5" "@babel/helper-plugin-utils" "^7.20.2" "@babel/helper-replace-supers" "^7.19.1" "@babel/helper-split-export-declaration" "^7.18.6" @@ -487,13 +443,13 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-proposal-private-property-in-object@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.18.6.tgz#a64137b232f0aca3733a67eb1a144c192389c503" - integrity sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz#309c7668f2263f1c711aa399b5a9a6291eef6135" + integrity sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.20.5" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": @@ -668,9 +624,9 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-block-scoping@^7.0.0", "@babel/plugin-transform-block-scoping@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.2.tgz#f59b1767e6385c663fd0bce655db6ca9c8b236ed" - integrity sha512-y5V15+04ry69OV2wULmwhEA6jwSWXO1TwAtIwiPXcvHcoOQUqpyMVd2bDsQJMW8AurjulIyUV8kDqtjSwHy1uQ== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.5.tgz#401215f9dc13dc5262940e2e527c9536b3d7f237" + integrity sha512-WvpEIW9Cbj9ApF3yJCjIEEf1EiNJLtXagOrL5LNWEZOo3jv8pmPoYTSNJQvqej8OavVlgOoOPw6/htGZro6IkA== dependencies: "@babel/helper-plugin-utils" "^7.20.2" @@ -800,12 +756,12 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-named-capturing-groups-regex@^7.0.0", "@babel/plugin-transform-named-capturing-groups-regex@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.19.1.tgz#ec7455bab6cd8fb05c525a94876f435a48128888" - integrity sha512-oWk9l9WItWBQYS4FgXD4Uyy5kq898lvkXpXQxoJEY1RnvPk4R/Dvu2ebXU9q8lP+rlMwUQTFf2Ok6d78ODa0kw== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz#626298dd62ea51d452c3be58b285d23195ba69a8" + integrity sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.19.0" - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-create-regexp-features-plugin" "^7.20.5" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-new-target@^7.18.6": version "7.18.6" @@ -830,9 +786,9 @@ "@babel/helper-replace-supers" "^7.18.6" "@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.20.1": - version "7.20.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.3.tgz#7b3468d70c3c5b62e46be0a47b6045d8590fb748" - integrity sha512-oZg/Fpx0YDrj13KsLyO8I/CX3Zdw7z0O9qOd95SqcoIzuqy/WTGWvePeHAnZCN54SfdyjHcb1S30gc8zlzlHcA== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.5.tgz#f8f9186c681d10c3de7620c916156d893c8a019e" + integrity sha512-h7plkOmcndIUWXZFLgpbrh2+fXAi47zcUX7IrOQuZdLD0I0KvjJ6cvo3BEcAOsDOcZhVKGJqv07mkSqK0y2isQ== dependencies: "@babel/helper-plugin-utils" "^7.20.2" @@ -891,12 +847,12 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-regenerator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.6.tgz#585c66cb84d4b4bf72519a34cfce761b8676ca73" - integrity sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz#57cda588c7ffb7f4f8483cc83bdcea02a907f04d" + integrity sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - regenerator-transform "^0.15.0" + "@babel/helper-plugin-utils" "^7.20.2" + regenerator-transform "^0.15.1" "@babel/plugin-transform-reserved-words@^7.18.6": version "7.18.6" @@ -1117,14 +1073,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.0", "@babel/runtime@^7.14.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.1.tgz#1148bb33ab252b165a06698fde7576092a78b4a9" - integrity sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg== - dependencies: - regenerator-runtime "^0.13.10" - -"@babel/runtime@^7.13.10": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.13.10", "@babel/runtime@^7.14.0", "@babel/runtime@^7.14.5", "@babel/runtime@^7.20.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": version "7.20.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.6.tgz#facf4879bfed9b5326326273a64220f099b0fce3" integrity sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA== @@ -1140,23 +1089,7 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.14.0", "@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.20.1", "@babel/traverse@^7.9.0": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.1.tgz#9b15ccbf882f6d107eeeecf263fbcdd208777ec8" - integrity sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.1" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.20.1" - "@babel/types" "^7.20.0" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.20.5": +"@babel/traverse@^7.14.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.20.1", "@babel/traverse@^7.20.5", "@babel/traverse@^7.9.0": version "7.20.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.5.tgz#78eb244bea8270fdda1ef9af22a5d5e5b7e57133" integrity sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ== @@ -1172,16 +1105,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.4.4", "@babel/types@^7.9.0": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.2.tgz#67ac09266606190f496322dbaff360fdaa5e7842" - integrity sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog== - dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" - to-fast-properties "^2.0.0" - -"@babel/types@^7.20.5": +"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.4.4", "@babel/types@^7.9.0": version "7.20.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.5.tgz#e206ae370b5393d94dfd1d04cd687cace53efa84" integrity sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg== @@ -1865,7 +1789,7 @@ resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== -"@graphql-typed-document-node/core@^3.1.0", "@graphql-typed-document-node/core@^3.1.1": +"@graphql-typed-document-node/core@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.1.tgz#076d78ce99822258cf813ecc1e7fa460fa74d052" integrity sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg== @@ -1957,9 +1881,9 @@ "@jridgewell/sourcemap-codec" "1.4.14" "@mattermost/react-native-paste-input@^0.5.1": - version "0.5.1" - resolved "https://registry.yarnpkg.com/@mattermost/react-native-paste-input/-/react-native-paste-input-0.5.1.tgz#2d24b2d4a9fdb0aaefda6df8d9c64380ac731dc1" - integrity sha512-2ZXohoSJbLyItzvdT3dyjlC7tvDBEXqvzxhKUHs4OnIslYZzHso9gfqjIZNfet8ryhYAJ3CgB+xCmP5u7ouFtQ== + version "0.5.2" + resolved "https://registry.yarnpkg.com/@mattermost/react-native-paste-input/-/react-native-paste-input-0.5.2.tgz#7443490f5c90f3c3db0f847c8b7249d23fa0066f" + integrity sha512-aQdLUidSAbWPLXWmwM1x8AhnZIO4EN5uWx813/G3+mL8kWD7mpXrQEvMpcdtKWatD705kCyKZkvnNY4yjq0TkA== dependencies: deprecated-react-native-prop-types "^2.3.0" @@ -2270,9 +2194,9 @@ merge-options "^3.0.4" "@react-native-camera-roll/camera-roll@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@react-native-camera-roll/camera-roll/-/camera-roll-5.1.0.tgz#5cfb3cf02d72ab03b3d6a0bdda392e2896c8d55f" - integrity sha512-74pavpt2T2U3V0r5d+pn4NChJbRNcydqakp3NVmosod35Lzxrt9My7kCLDdHXW2S6J6DhgXb/n36/heZQB4AUA== + version "5.2.0" + resolved "https://registry.yarnpkg.com/@react-native-camera-roll/camera-roll/-/camera-roll-5.2.0.tgz#a30dca7c486379650c03fb8cc6fe35b7de6eeb82" + integrity sha512-CIFkEqWeMtFo3fG/0nULrmLs8xikbOUuEty8wWxpyBWq7OM9Hi13pXJ1FWrIrxDcFuL7d0bxIqpqNrt59lAPrQ== "@react-native-clipboard/clipboard@^1.11.1": version "1.11.1" @@ -2481,45 +2405,45 @@ integrity sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ== "@react-navigation/bottom-tabs@^6.4.3": - version "6.4.3" - resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-6.4.3.tgz#38498ade0e03294d7ba7fdcd96ab347c7ad1eb04" - integrity sha512-nkuHJ31mEyrZZPswfMAHZgUTEm11ohN9Fy54wao2HFk1VM4eplijX6pFGycA4yhKy73A/aesKhghVPzR+FaSmg== + version "6.5.0" + resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-6.5.0.tgz#8bcd98733988ffe3e5124b45920608f22b2576e4" + integrity sha512-7jKBHAk/HpIwXEsKKegB0DabPhFWS9PH2Bsmd4HUdvHj103m7H3OsrszuPB9Uxbe3RkGNtcJzeQnYOanVzNR+w== dependencies: - "@react-navigation/elements" "^1.3.9" + "@react-navigation/elements" "^1.3.10" color "^4.2.3" warn-once "^0.1.0" -"@react-navigation/core@^6.4.3": - version "6.4.3" - resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-6.4.3.tgz#5609bab95e3080d190eff46a64e52cc06eb0c4cf" - integrity sha512-+HGHeEq7GK029Jy2jFkV2uQYc6a6AurjjUAVFlSz5tsNo4L5E3ZCzo7sk5+lcvt0Agdedf5Q+wTiWjT7IrixgA== +"@react-navigation/core@^6.4.4": + version "6.4.4" + resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-6.4.4.tgz#270ef88d3c3a225f9a58bbe89eb8a8bc96af44a9" + integrity sha512-skdTzr6sOceEusEDG+e58zaSpgy1Yz7eZGFtmkmdYAFkZDy5nkIY/0nYuXP0waUYarNXg6lNEVkF995/kZXHZg== dependencies: "@react-navigation/routers" "^6.1.5" escape-string-regexp "^4.0.0" nanoid "^3.1.23" - query-string "^7.0.0" + query-string "^7.1.3" react-is "^16.13.0" use-latest-callback "^0.1.5" -"@react-navigation/elements@^1.3.9": - version "1.3.9" - resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.9.tgz#33e26d7ad655b012e024ef0a005a3f66201287f8" - integrity sha512-V9aIZN19ufaKWlXT4UcM545tDiEt9DIQS+74pDgbnzoQcDypn0CvSqWopFhPACMdJatgmlZUuOrrMfTeNrBWgA== +"@react-navigation/elements@^1.3.10": + version "1.3.10" + resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.10.tgz#7f4281eddef5ff424169413daaab9a66b27c4949" + integrity sha512-JFaoZG9S+Zz291CvAMeGw8kNl/g2AaY9Pbo+VcYO+JM6UF/E5Obq9ga2ydxDrn3an7wzdl6flA/4lWhqG82Vqw== "@react-navigation/native-stack@^6.9.4": - version "6.9.4" - resolved "https://registry.yarnpkg.com/@react-navigation/native-stack/-/native-stack-6.9.4.tgz#d9cc26ad97afcee1c0e3fb092ae4c60f848b1572" - integrity sha512-R40G2Zfo748hE4+we/TUAEClw53l0QdFDJ0q/9VS1moxgI4zUopdBxN5SmF32OMFfkedMRAT9J+aVbwgmdn7pA== + version "6.9.5" + resolved "https://registry.yarnpkg.com/@react-navigation/native-stack/-/native-stack-6.9.5.tgz#805adf6699524519ff4bf50ac960a923da1bc223" + integrity sha512-1ZIrla+b4gB8KDC6QewtZ/1yOS23bQctwR4Pf6ECA0stEH8ibbxh70iiI/LluL5CtWxrWfgOrl1jpQsVvtKY+Q== dependencies: - "@react-navigation/elements" "^1.3.9" + "@react-navigation/elements" "^1.3.10" warn-once "^0.1.0" "@react-navigation/native@^6.0.16": - version "6.0.16" - resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-6.0.16.tgz#a37df62da9db912c91c53e2cdeadb954865a6a9b" - integrity sha512-YVmzypkDppV/vAG+66KTJ2RFtPjhDTLLjgk8TNTCHG3pahq1q13zbnEPjqB42bU4kgL5SG17O4saErt1DJaWQg== + version "6.1.0" + resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-6.1.0.tgz#ea0c79b6b0f67397305fec54eb4dbc3dd3eb087b" + integrity sha512-CdjOmbE4c/UczczqeP7ZrFXJcjnXOCwY1PDNjX51Ph1b2tHXpQ41/089k3R49dc5i2sFLk6jKaryFU2dcLr8jw== dependencies: - "@react-navigation/core" "^6.4.3" + "@react-navigation/core" "^6.4.4" escape-string-regexp "^4.0.0" fast-deep-equal "^3.1.3" nanoid "^3.1.23" @@ -2532,11 +2456,11 @@ nanoid "^3.1.23" "@react-navigation/stack@^6.3.7": - version "6.3.7" - resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-6.3.7.tgz#a2c0e08c8cc8696da203eba6905025ce8665f40a" - integrity sha512-M0gGeIpXmY08ZxZlHO9o/NLj9lO4zGdTll+a9e40BwfSxR5v6R34msKHUJ57nxrzvr2/MSSllZRkW3wc8woKFg== + version "6.3.8" + resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-6.3.8.tgz#bc36beb4fba1c47a45e01c9dcc501be0f6f10d54" + integrity sha512-tnSmI5wmRLA293tPo43niCOOcWsWFB1XPGeUBVsz/lJnQZIHUUx0h42t53fU22DHGXee7PiZ78Lvr1Q0m/JZJQ== dependencies: - "@react-navigation/elements" "^1.3.9" + "@react-navigation/elements" "^1.3.10" color "^4.2.3" warn-once "^0.1.0" @@ -2736,6 +2660,19 @@ dependencies: defer-to-connect "^2.0.0" +"@tanstack/query-core@4.19.1": + version "4.19.1" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.19.1.tgz#2e92d9e8a50884eb231c5beb4386e131ebe34306" + integrity sha512-Zp0aIose5C8skBzqbVFGk9HJsPtUhRVDVNWIqVzFbGQQgYSeLZMd3Sdb4+EnA5wl1J7X+bre2PJGnQg9x/zHOA== + +"@tanstack/react-query@^4.19.1": + version "4.19.1" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-4.19.1.tgz#43356dd537127e76d75f5a2769eb23dafd9a3690" + integrity sha512-5dvHvmc0vrWI03AJugzvKfirxCyCLe+qawrWFCXdu8t7dklIhJ7D5ZhgTypv7mMtIpdHPcECtCiT/+V74wCn2A== + dependencies: + "@tanstack/query-core" "4.19.1" + use-sync-external-store "^1.2.0" + "@types/cacheable-request@^6.0.1": version "6.0.3" resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" @@ -2829,9 +2766,9 @@ integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== "@types/node@*": - version "18.11.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4" - integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg== + version "18.11.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.12.tgz#89e7f8aa8c88abf432f9bd594888144d7dba10aa" + integrity sha512-FgD3NtTAKvyMmD44T07zz2fEf+OKwutgBCEVM8GcvMGVGaDktiLNTDvPwC/LUe3PinMW+X6CuLOF2Ui1mAlSXg== "@types/prop-types@*": version "15.7.5" @@ -2866,9 +2803,9 @@ integrity sha512-Qa9DGfL6Bvng2DXgCK0fFzdi9SJMGfs06MLSkCfSXBCGKlFLzSHCsXztvXlCCChn3dQArFHyz/uRUN3Sbt6LtQ== "@types/react-native@~0.70.7": - version "0.70.7" - resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.70.7.tgz#1708e5f746bbce2ea4e0bd5a2627560667804d46" - integrity sha512-hBzeUWwk8sfj3vDfwEXb4hbjWjl0jb5CvWlu2gLrOUJyFHVzJ+x6Y9ilO2eVtJW7l5QmmNLILE1PkVfKRkqYuQ== + version "0.70.8" + resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.70.8.tgz#3302a0f7eddcd3350448ca17a9e415d02b1efde6" + integrity sha512-jvs5QMOrlyi0ScfT5Brha2roDoOWtbIOadNkp0jsueVen5+pH4SQAYtzL6xu0+dIcx3J/5LtZ/JYby2C1/zUug== dependencies: "@types/react" "*" @@ -2879,16 +2816,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@16 || 17 || 18": - version "18.0.25" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.25.tgz#8b1dcd7e56fe7315535a4af25435e0bb55c8ae44" - integrity sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g== - dependencies: - "@types/prop-types" "*" - "@types/scheduler" "*" - csstype "^3.0.2" - -"@types/react@~18.0.26": +"@types/react@*", "@types/react@16 || 17 || 18", "@types/react@~18.0.26": version "18.0.26" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.26.tgz#8ad59fc01fef8eaf5c74f4ea392621749f0b7917" integrity sha512-hCR3PJQsAIXyxhTNSiDFY//LhnMZWpNNr5etoCqx/iUfGc5gXWtQR2Phl908jVR6uPXacojQWTg4qRpkxTuGug== @@ -2990,12 +2918,11 @@ wonka "^4.0.14" "@urql/core@>=2.3.1": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@urql/core/-/core-3.0.5.tgz#a26c326dd788d6d6abb839493bce86147f5a45c9" - integrity sha512-6/1HG+WEAcPs+hXSFnxWBTWkNUwa8dj2cHysWokMaFIbAioGtUaSdxp2q9FDMtWAIGdc640NFSt2B8itGLdoAA== + version "3.1.1" + resolved "https://registry.yarnpkg.com/@urql/core/-/core-3.1.1.tgz#a49cd572360d01f2469a786b294fba2269a65e53" + integrity sha512-Mnxtq4I4QeFJsgs7Iytw+HyhiGxISR6qtyk66c9tipozLZ6QVxrCiUPF2HY4BxNIabaxcp+rivadvm8NAnXj4Q== dependencies: - "@graphql-typed-document-node/core" "^3.1.1" - wonka "^6.0.0" + wonka "^6.1.2" "@urql/exchange-retry@0.3.0": version "0.3.0" @@ -3255,9 +3182,9 @@ ajv@^6.1.0, ajv@^6.10.2, ajv@^6.12.4, ajv@^6.12.5: uri-js "^4.2.2" ajv@^8.0.0, ajv@^8.1.0: - version "8.11.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" - integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== + version "8.11.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.2.tgz#aecb20b50607acf2569b6382167b65a96008bb78" + integrity sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -3360,9 +3287,9 @@ anymatch@^2.0.0: normalize-path "^2.1.1" anymatch@^3.0.0, anymatch@^3.0.3, anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" @@ -3373,9 +3300,9 @@ appdirsjs@^1.2.4: integrity sha512-Quji6+8kLBC3NnBeo14nPDq0+2jUs5s3/xEye+udFHumHhRk4M7aAMXp/PBJqkKYGuuyR9M/6Dq7d2AViiGmhw== application-config-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/application-config-path/-/application-config-path-0.1.0.tgz#193c5f0a86541a4c66fba1e2dc38583362ea5e8f" - integrity sha512-lljTpVvFteShrHuKRvweZfa9o/Nc34Y8r5/1Lqh/yyKaspRT2J3fkEiSSk1YLG8ZSVyU7yHysRy9zcDDS2aH1Q== + version "0.1.1" + resolved "https://registry.yarnpkg.com/application-config-path/-/application-config-path-0.1.1.tgz#8b5ac64ff6afdd9bd70ce69f6f64b6998f5f756e" + integrity sha512-zy9cHePtMP0YhwG+CfHm0bgwdnga2X3gZexpdCwEj//dpb+TKajtiC8REEUJUSq6Ab4f9cgNy2l8ObXzCXFkEw== aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" @@ -3741,7 +3668,7 @@ better-opn@^3.0.1, better-opn@~3.0.2: dependencies: open "^8.0.4" -big-integer@1.6.x, big-integer@^1.6.16, big-integer@^1.6.44: +big-integer@1.6.x, big-integer@^1.6.44: version "1.6.51" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== @@ -3937,20 +3864,6 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -broadcast-channel@^3.4.1: - version "3.7.0" - resolved "https://registry.yarnpkg.com/broadcast-channel/-/broadcast-channel-3.7.0.tgz#2dfa5c7b4289547ac3f6705f9c00af8723889937" - integrity sha512-cIAKJXAxGJceNZGTZSBzMxzyOn72cVgPnKx4dc6LRjQgbaJUQqhy5rzL3zbMxkMWsGKkv2hSFkPRMEXfoMZ2Mg== - dependencies: - "@babel/runtime" "^7.7.2" - detect-node "^2.1.0" - js-sha3 "0.8.0" - microseconds "0.2.0" - nano-time "1.0.0" - oblivious-set "1.0.0" - rimraf "3.0.2" - unload "2.2.0" - brorand@^1.0.1, brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" @@ -4276,9 +4189,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001400: - version "1.0.30001431" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz#e7c59bd1bc518fae03a4656be442ce6c4887a795" - integrity sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ== + version "1.0.30001439" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001439.tgz#ab7371faeb4adff4b74dad1718a6fd122e45d9cb" + integrity sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A== caseless@^0.12.0: version "0.12.0" @@ -4367,9 +4280,9 @@ ci-info@^2.0.0: integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== ci-info@^3.2.0, ci-info@^3.3.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.5.0.tgz#bfac2a29263de4c829d806b1ab478e35091e171f" - integrity sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw== + version "3.7.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.0.tgz#6d01b3696c59915b6ce057e4aa4adfc2fa25f5ef" + integrity sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" @@ -4791,9 +4704,9 @@ copy-webpack-plugin@~6.0.3: webpack-sources "^1.4.3" core-js-compat@^3.25.1: - version "3.26.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.26.0.tgz#94e2cf8ba3e63800c4956ea298a6473bc9d62b44" - integrity sha512-piOX9Go+Z4f9ZiBFLnZ5VrOpBl0h7IGCkiFUN11QTe6LjAvOT3ifL/5TdoizMh99hcGy5SoLyWbapIY/PIb/3A== + version "3.26.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.26.1.tgz#0e710b09ebf689d719545ac36e49041850f943df" + integrity sha512-622/KzTudvXCDLRw70iHW4KKs1aGpcRcowGWyYJr2DEBfRrd6hNJybxSWJFuZYD4ma86xhrwDDHxmDaIq4EA8A== dependencies: browserslist "^4.21.4" @@ -5103,9 +5016,9 @@ dateformat@3.0.3: integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== dayjs@^1.8.15: - version "1.11.6" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.6.tgz#2e79a226314ec3ec904e3ee1dd5a4f5e5b1c7afb" - integrity sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ== + version "1.11.7" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" + integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ== debug@2, debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0: version "2.6.9" @@ -5140,7 +5053,7 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -decode-uri-component@^0.2.0: +decode-uri-component@^0.2.0, decode-uri-component@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== @@ -5330,7 +5243,7 @@ detect-node-es@^1.1.0: resolved "https://registry.yarnpkg.com/detect-node-es/-/detect-node-es-1.1.0.tgz#163acdf643330caa0b4cd7c21e7ee7755d6fa493" integrity sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ== -detect-node@^2.0.4, detect-node@^2.1.0: +detect-node@^2.0.4: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== @@ -5645,9 +5558,9 @@ errorhandler@^1.5.0: escape-html "~1.0.3" es-abstract@^1.17.2, es-abstract@^1.19.0, es-abstract@^1.20.4: - version "1.20.4" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.4.tgz#1d103f9f8d78d4cf0713edcd6d0ed1a46eed5861" - integrity sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA== + version "1.20.5" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.5.tgz#e6dc99177be37cacda5988e692c3fa8b218e95d2" + integrity sha512-7h8MM2EQhsCA7pU/Nv78qOXFpD8Rhqd12gYiSJVkrH9+e8VuA8JlPJK/hQjjlLv6pJvx/z1iRFKzYb0XT/RuAQ== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" @@ -5655,6 +5568,7 @@ es-abstract@^1.17.2, es-abstract@^1.19.0, es-abstract@^1.20.4: function.prototype.name "^1.1.5" get-intrinsic "^1.1.3" get-symbol-description "^1.0.0" + gopd "^1.0.1" has "^1.0.3" has-property-descriptors "^1.0.0" has-symbols "^1.0.3" @@ -5670,8 +5584,8 @@ es-abstract@^1.17.2, es-abstract@^1.19.0, es-abstract@^1.20.4: object.assign "^4.1.4" regexp.prototype.flags "^1.4.3" safe-regex-test "^1.0.0" - string.prototype.trimend "^1.0.5" - string.prototype.trimstart "^1.0.5" + string.prototype.trimend "^1.0.6" + string.prototype.trimstart "^1.0.6" unbox-primitive "^1.0.2" es-array-method-boxes-properly@^1.0.0: @@ -6239,9 +6153,9 @@ fast-json-stable-stringify@^2.0.0: integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + version "1.14.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.14.0.tgz#107f69d7295b11e0fccc264e1fc6389f623731ce" + integrity sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg== dependencies: reusify "^1.0.4" @@ -6444,9 +6358,9 @@ find-yarn-workspace-root@^2.0.0, find-yarn-workspace-root@~2.0.0: micromatch "^4.0.2" flow-parser@0.*: - version "0.192.0" - resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.192.0.tgz#e2aa03e0c6a844c4d6ccdb4af2bc83cc589d9c8c" - integrity sha512-FLyei0ikf4ab9xlg+05WNmdpOODiH9XVBuw7iI9OZyjIo+cX2L2OUPTovjbWLYLlI41oGTcprbKdB/f9XwBnKw== + version "0.195.1" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.195.1.tgz#1f4017afd46c7873ed8dd9505f5fe5f00e08dd6c" + integrity sha512-8U3yQ8dny+CIsAjnH1QqpNw1mxLmqyp+0Mz/uh+YIH7srDkfabebwtFSnGv2m8yB2ZEPBrPwFYHe1kHKr/KQuw== flow-parser@^0.121.0: version "0.121.0" @@ -6844,9 +6758,9 @@ gopd@^1.0.1: get-intrinsic "^1.1.3" got@^11.1.4: - version "11.8.5" - resolved "https://registry.yarnpkg.com/got/-/got-11.8.5.tgz#ce77d045136de56e8f024bebb82ea349bc730046" - integrity sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ== + version "11.8.6" + resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" + integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== dependencies: "@sindresorhus/is" "^4.0.0" "@szmarczak/http-timer" "^4.0.5" @@ -7262,11 +7176,11 @@ https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1: debug "4" i18next@^22.0.6: - version "22.0.6" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-22.0.6.tgz#d7029912f8aa74ff295c0d9afd1b7dea45859b49" - integrity sha512-RlreNGoPIdDP4QG+qSA9PxZKGwlzmcozbI9ObI6+OyUa/Rp0EjZZA9ubyBjw887zVNZsC+7FI3sXX8oiTzAfig== + version "22.1.5" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-22.1.5.tgz#5c395b807aa670ce82a7c4f6831b7fba8f1e2c6c" + integrity sha512-Mjj45PbpZByE+c6ddLEkkj0LUyzJP1cRGeC/+O6mvp1+GAwW7rIx6aOPW9+Zxe+JO3EcJCAkibwbZrgBRF/qRA== dependencies: - "@babel/runtime" "^7.17.2" + "@babel/runtime" "^7.20.6" iconv-lite@0.4.23: version "0.4.23" @@ -7300,9 +7214,9 @@ iferr@^0.1.5: integrity sha512-DUNFN5j7Tln0D+TxzloUjKB+CtVu6myn0JEFak6dG18mNt9YkQ6lzGCdafwofISZ1lLF3xRHJ98VKy9ynkcFaA== ignore@^5.1.4, ignore@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + version "5.2.1" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.1.tgz#c2b1f76cb999ede1502f3a226a9310fdfe88d46c" + integrity sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA== image-size@^0.6.0: version "0.6.3" @@ -7999,11 +7913,6 @@ join-component@^1.1.0: resolved "https://registry.yarnpkg.com/join-component/-/join-component-1.1.0.tgz#b8417b750661a392bee2c2537c68b2a9d4977cd5" integrity sha512-bF7vcQxbODoGK1imE2P9GS9aw4zD0Sd+Hni68IMZLj7zRnquH7dXUmMw9hDI5S/Jzt7q+IyTXN0rSg2GI0IKhQ== -js-sha3@0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -8456,14 +8365,6 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -match-sorter@^6.0.2: - version "6.3.1" - resolved "https://registry.yarnpkg.com/match-sorter/-/match-sorter-6.3.1.tgz#98cc37fda756093424ddf3cbc62bfe9c75b92bda" - integrity sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw== - dependencies: - "@babel/runtime" "^7.12.5" - remove-accents "0.4.2" - md5-file@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/md5-file/-/md5-file-3.2.3.tgz#f9bceb941eca2214a4c0727f5e700314e770f06f" @@ -8873,11 +8774,6 @@ micromatch@^4.0.2, micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" -microseconds@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/microseconds/-/microseconds-0.2.0.tgz#233b25f50c62a65d861f978a4a4f8ec18797dc39" - integrity sha512-n7DHHMjR1avBbSpsTBj6fmMGh2AGrifVV4e+WYc3Q9lO+xnSZ3NyhcBND3vzzatt05LFhoKFRxrIyklmLlUtyA== - miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -9000,9 +8896,16 @@ minipass@3.1.6: yallist "^4.0.0" minipass@^3.0.0, minipass@^3.1.1: - version "3.3.4" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.4.tgz#ca99f95dd77c43c7a76bf51e6d200025eee0ffae" - integrity sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw== + version "3.3.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" + integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== + dependencies: + yallist "^4.0.0" + +minipass@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.0.0.tgz#7cebb0f9fa7d56f0c5b17853cbe28838a8dbbd3b" + integrity sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw== dependencies: yallist "^4.0.0" @@ -9118,13 +9021,6 @@ nan@^2.12.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== -nano-time@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/nano-time/-/nano-time-1.0.0.tgz#b0554f69ad89e22d0907f7a12b0993a5d96137ef" - integrity sha512-flnngywOoQ0lLQOTRNexn2gGSNuM9bKj9RZAWSzhQ+UJYaAFG9bac4DW9VHjUAzrOaIcajHybCTHe/bkvozQqA== - dependencies: - big-integer "^1.6.16" - nanoid@^3.1.23: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" @@ -9460,11 +9356,6 @@ object.values@^1.1.0: define-properties "^1.1.4" es-abstract "^1.20.4" -oblivious-set@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/oblivious-set/-/oblivious-set-1.0.0.tgz#c8316f2c2fb6ff7b11b6158db3234c49f733c566" - integrity sha512-z+pI07qxo4c2CulUHCDf9lcqDlMSo72N/4rLUpRXf6fu+q8vjt8y0xS+Tlf8NTJDdTXHbdeO1n3MlbctwEoXZw== - obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" @@ -10289,9 +10180,9 @@ postcss-selector-parser@^3.0.0: uniq "^1.0.1" postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2: - version "6.0.10" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz#79b61e2c0d1bfc2602d549e11d0876256f8df88d" - integrity sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w== + version "6.0.11" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz#2e41dc39b7ad74046e1615185185cd0b17d0c8dc" + integrity sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g== dependencies: cssesc "^3.0.0" util-deprecate "^1.0.2" @@ -10558,12 +10449,12 @@ query-string@^5.0.1: object-assign "^4.1.0" strict-uri-encode "^1.0.0" -query-string@^7.0.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.1.tgz#754620669db978625a90f635f12617c271a088e1" - integrity sha512-MplouLRDHBZSG9z7fpuAAcI7aAYjDLhtsiVZsevsfaHWDS2IDdORKbSd1kWUA+V4zyva/HZoSfpwnYMMQDhb0w== +query-string@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328" + integrity sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg== dependencies: - decode-uri-component "^0.2.0" + decode-uri-component "^0.2.2" filter-obj "^1.1.0" split-on-first "^1.0.0" strict-uri-encode "^2.0.0" @@ -10726,9 +10617,9 @@ react-freeze@^1.0.0: integrity sha512-ZnXwLQnGzrDpHBHiC56TXFXvmolPeMjTn1UOm610M4EXGzbEDR7oOIyS2ZiItgbs6eZc4oU/a0hpk8PrcKvv5g== react-i18next@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-12.0.0.tgz#634015a2c035779c5736ae4c2e5c34c1659753b1" - integrity sha512-/O7N6aIEAl1FaWZBNvhdIo9itvF/MO/nRKr9pYqRc9LhuC1u21SlfwpiYQqvaeNSEW3g3qUXLREOWMt+gxrWbg== + version "12.1.1" + resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-12.1.1.tgz#2626cdbfe6bcb76ef833861c0184a5c4e5e3c089" + integrity sha512-mFdieOI0LDy84q3JuZU6Aou1DoWW2fhapcTGeBS8+vWSJuViuoCLQAMYSb0QoHhXS8B0WKUOPpx4cffAP7r/aA== dependencies: "@babel/runtime" "^7.14.5" html-parse-stringify "^3.0.1" @@ -10918,9 +10809,9 @@ react-native-swipe-list-view@^3.2.9: integrity sha512-SjAEuHc/D6ovp+RjDUhfNmw6NYOntdT7+GFhfMGfP/BSLMuMWynpzJy9GKQeyB8sI78T6Lzip21TVbongOg1Mw== react-native-tab-view@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-3.3.2.tgz#4afc995e41b97e0457e95b487763d3f9dc318dcc" - integrity sha512-s0xr+wiMBHdjsWgbPTyZemgv7jJ+zKPBw/MIQIlKAMo4VCNV1vAZEbOHaHpGbqgYFwsmFXjKZNXQ5UJAIJXlDQ== + version "3.3.3" + resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-3.3.3.tgz#33a94db2ccbe7fe8fff0c0e3f1da09cbd07edba7" + integrity sha512-hrxGu/Bj/GRXt+6ErqUFMAw2E82tjeTJ97nH1dZ2FSnLYOVnY9FDqju8TkQtT3GpJGL6Ur/ZkRT4eQfYwTZbtg== dependencies: use-latest-callback "^0.1.5" @@ -10962,15 +10853,6 @@ react-native@0.70.6: whatwg-fetch "^3.0.0" ws "^6.1.4" -react-query@^3.39.2: - version "3.39.2" - resolved "https://registry.yarnpkg.com/react-query/-/react-query-3.39.2.tgz#9224140f0296f01e9664b78ed6e4f69a0cc9216f" - integrity sha512-F6hYDKyNgDQfQOuR1Rsp3VRzJnWHx6aRnnIZHMNGGgbL3SBgpZTDg8MQwmxOgpCAoqZJA+JSNCydF1xGJqKOCA== - dependencies: - "@babel/runtime" "^7.5.5" - broadcast-channel "^3.4.1" - match-sorter "^6.0.2" - react-redux@^8.0.5: version "8.0.5" resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-8.0.5.tgz#e5fb8331993a019b8aaf2e167a93d10af469c7bd" @@ -11142,20 +11024,15 @@ regenerate@^1.4.2: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.13.10, regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.4: - version "0.13.10" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz#ed07b19616bcbec5da6274ebc75ae95634bfc2ee" - integrity sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw== - -regenerator-runtime@^0.13.11: +regenerator-runtime@^0.13.11, regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.4: version "0.13.11" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== -regenerator-transform@^0.15.0: - version "0.15.0" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.0.tgz#cbd9ead5d77fae1a48d957cf889ad0586adb6537" - integrity sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg== +regenerator-transform@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56" + integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg== dependencies: "@babel/runtime" "^7.8.4" @@ -11176,17 +11053,17 @@ regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.4.3: define-properties "^1.1.3" functions-have-names "^1.2.2" -regexpu-core@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.1.tgz#a69c26f324c1e962e9ffd0b88b055caba8089139" - integrity sha512-HrnlNtpvqP1Xkb28tMhBUO2EbyUHdQlsnlAhzWcwHy8WJR53UWr7/MAvqrsQKMbV4qdpv03oTMG8iIhfsPFktQ== +regexpu-core@^5.2.1: + version "5.2.2" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.2.tgz#3e4e5d12103b64748711c3aad69934d7718e75fc" + integrity sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw== dependencies: regenerate "^1.4.2" regenerate-unicode-properties "^10.1.0" regjsgen "^0.7.1" regjsparser "^0.9.1" unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.0.0" + unicode-match-property-value-ecmascript "^2.1.0" registry-auth-token@3.3.2: version "3.3.2" @@ -11242,11 +11119,6 @@ relateurl@^0.2.7: resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog== -remove-accents@0.4.2: - version "0.4.2" - resolved "https://registry.yarnpkg.com/remove-accents/-/remove-accents-0.4.2.tgz#0a43d3aaae1e80db919e07ae254b285d9e1c7bb5" - integrity sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA== - remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -11410,13 +11282,6 @@ rgba-regex@^1.0.0: resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" integrity sha512-zgn5OjNQXLUTdq8m17KdaicF6w89TZs8ZU8y0AYENIU6wG8GG6LLm0yLSiPY8DmaYmHdgRW8rnApjoT0fQRfMg== -rimraf@3.0.2, rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -11424,6 +11289,13 @@ rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3: dependencies: glob "^7.1.3" +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + rimraf@~2.2.6: version "2.2.8" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" @@ -12145,7 +12017,7 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string.prototype.trimend@^1.0.5: +string.prototype.trimend@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== @@ -12154,7 +12026,7 @@ string.prototype.trimend@^1.0.5: define-properties "^1.1.4" es-abstract "^1.20.4" -string.prototype.trimstart@^1.0.5: +string.prototype.trimstart@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== @@ -12245,9 +12117,9 @@ stylehacks@^4.0.0: postcss-selector-parser "^3.0.0" sucrase@^3.20.0: - version "3.28.0" - resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.28.0.tgz#7fd8b3118d2155fcdf291088ab77fa6eefd63c4c" - integrity sha512-TK9600YInjuiIhVM3729rH4ZKPOsGeyXUwY+Ugu9eilNbdTFyHr6XcAGYbRVZPDgWj6tgI7bx95aaJjHnbffag== + version "3.29.0" + resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.29.0.tgz#3207c5bc1b980fdae1e539df3f8a8a518236da7d" + integrity sha512-bZPAuGA5SdFHuzqIhTAqt9fvNEo9rESqXIG3oiKdF8K4UmkQxC4KlNL3lVyAErXp+mPvUqZ5l13qx6TrDIGf3A== dependencies: commander "^4.0.0" glob "7.1.6" @@ -12337,13 +12209,13 @@ tapable@^1.0.0, tapable@^1.1.3: integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== tar@^6.0.2, tar@^6.0.5: - version "6.1.12" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.12.tgz#3b742fb05669b55671fb769ab67a7791ea1a62e6" - integrity sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw== + version "6.1.13" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.13.tgz#46e22529000f612180601a6fe0680e7da508847b" + integrity sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" - minipass "^3.0.0" + minipass "^4.0.0" minizlib "^2.1.1" mkdirp "^1.0.3" yallist "^4.0.0" @@ -12661,9 +12533,9 @@ typedarray@^0.0.6: integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== typescript@^4.9.3: - version "4.9.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db" - integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA== + version "4.9.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" + integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== ua-parser-js@^0.7.30: version "0.7.32" @@ -12706,10 +12578,10 @@ unicode-match-property-ecmascript@^2.0.0: unicode-canonical-property-names-ecmascript "^2.0.0" unicode-property-aliases-ecmascript "^2.0.0" -unicode-match-property-value-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz#1a01aa57247c14c568b89775a54938788189a714" - integrity sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw== +unicode-match-property-value-ecmascript@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" + integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== unicode-property-aliases-ecmascript@^2.0.0: version "2.1.0" @@ -12779,14 +12651,6 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== -unload@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/unload/-/unload-2.2.0.tgz#ccc88fdcad345faa06a92039ec0f80b488880ef7" - integrity sha512-B60uB5TNBLtN6/LsgAf3udH9saB5p7gqJwcFfbOEZ8BcBHnGwCf6G/TGiEqkRAxX7zAFIUtzdrXQSdL3Q/wqNA== - dependencies: - "@babel/runtime" "^7.6.2" - detect-node "^2.0.4" - unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -12900,7 +12764,7 @@ use-sidecar@^1.1.2: detect-node-es "^1.1.0" tslib "^2.0.0" -use-sync-external-store@^1.0.0: +use-sync-external-store@^1.0.0, use-sync-external-store@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== @@ -13278,10 +13142,10 @@ wonka@^4.0.14: resolved "https://registry.yarnpkg.com/wonka/-/wonka-4.0.15.tgz#9aa42046efa424565ab8f8f451fcca955bf80b89" integrity sha512-U0IUQHKXXn6PFo9nqsHphVCE5m3IntqZNB9Jjn7EB1lrR7YTDY3YWgFvEvwniTzXSvOH/XMzAZaIfJF/LvHYXg== -wonka@^6.0.0: - version "6.1.1" - resolved "https://registry.yarnpkg.com/wonka/-/wonka-6.1.1.tgz#134ece7d07848477e3a8b7d35f2333af2edde138" - integrity sha512-shBtyZ0KFvUadtnDGlTRA4mF4pgcRoyZKikdputKhmShoXWcZDvlg6CUw6Jx9nTL7Ub8QUJoIarPpxdlosg9cw== +wonka@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/wonka/-/wonka-6.1.2.tgz#2c66fa5b26a12f002a03619b988258313d0b5352" + integrity sha512-zNrXPMccg/7OEp9tSfFkMgTvhhowqasiSHdJ3eCZolXxVTV/aT6HUTofoZk9gwRbGoFey/Nss3JaZKUMKMbofg== worker-farm@^1.7.0: version "1.7.0" From bdbacf579efe6ffa89830e12ca68947571936d68 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sat, 10 Dec 2022 20:19:18 +0100 Subject: [PATCH 3/9] Fixed #536 --- src/components/Hashtag.tsx | 37 +++++++---- src/components/Sparkline.tsx | 3 +- src/i18n/en/common.json | 1 + src/i18n/en/screens/tabs.json | 5 +- src/screens/Tabs/Me.tsx | 48 +++----------- src/screens/Tabs/Me/FollowedTags.tsx | 71 +++++++++++++++++++++ src/screens/Tabs/Me/List/List.tsx | 6 +- src/screens/Tabs/Me/Root/Collections.tsx | 60 +++++++++-------- src/screens/Tabs/Shared/Hashtag.tsx | 11 ++-- src/utils/migrations/instances/migration.ts | 1 + src/utils/migrations/instances/v11.ts | 1 + src/utils/navigation/navigators.ts | 1 + src/utils/queryHooks/tags.ts | 47 ++++++++------ src/utils/queryHooks/utils.ts | 8 +++ src/utils/slices/instances/add.ts | 1 + 15 files changed, 193 insertions(+), 108 deletions(-) create mode 100644 src/screens/Tabs/Me/FollowedTags.tsx create mode 100644 src/utils/queryHooks/utils.ts diff --git a/src/components/Hashtag.tsx b/src/components/Hashtag.tsx index 2d05edc9..1402d7ac 100644 --- a/src/components/Hashtag.tsx +++ b/src/components/Hashtag.tsx @@ -3,8 +3,8 @@ import { StackNavigationProp } from '@react-navigation/stack' import { TabLocalStackParamList } from '@utils/navigation/navigators' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' -import React, { useCallback, useState } from 'react' -import { Dimensions, Pressable } from 'react-native' +import React, { PropsWithChildren, useCallback, useState } from 'react' +import { Dimensions, Pressable, View } from 'react-native' import Sparkline from './Sparkline' import CustomText from './Text' @@ -13,7 +13,11 @@ export interface Props { onPress?: () => void } -const ComponentHashtag: React.FC = ({ hashtag, onPress: customOnPress }) => { +const ComponentHashtag: React.FC = ({ + hashtag, + onPress: customOnPress, + children +}) => { const { colors } = useTheme() const navigation = useNavigation>() @@ -31,15 +35,11 @@ const ComponentHashtag: React.FC = ({ hashtag, onPress: customOnPress }) style={{ flex: 1, flexDirection: 'row', + alignItems: 'center', justifyContent: 'space-between', padding }} onPress={customOnPress || onPress} - onLayout={({ - nativeEvent: { - layout: { height } - } - }) => setHeight(height - padding * 2 - 1)} > = ({ hashtag, onPress: customOnPress }) > #{hashtag.name} - parseInt(h.uses)).reverse()} - width={width} - height={height} - /> + setHeight(height)} + > + parseInt(h.uses)).reverse()} + width={width} + height={height} + margin={children ? StyleConstants.Spacing.S : undefined} + /> + {children} + ) } diff --git a/src/components/Sparkline.tsx b/src/components/Sparkline.tsx index 21792069..707f28e7 100644 --- a/src/components/Sparkline.tsx +++ b/src/components/Sparkline.tsx @@ -1,7 +1,6 @@ import { useTheme } from '@utils/styles/ThemeManager' import { maxBy, minBy } from 'lodash' import React from 'react' -import { Platform } from 'react-native' import Svg, { G, Path } from 'react-native-svg' export interface Props { @@ -69,7 +68,7 @@ const Sparkline: React.FC = ({ data, width, height, margin = 0 }) => { const fillPoints = linePoints.concat(closePolyPoints) return ( - + ({ title: t('me.stacks.bookmarks.name'), - ...(Platform.OS === 'android' && { - headerCenter: () => - }), headerLeft: () => navigation.pop(1)} /> })} /> @@ -53,9 +50,6 @@ const TabMe = React.memo( component={TabMeConversations} options={({ navigation }: any) => ({ title: t('me.stacks.conversations.name'), - ...(Platform.OS === 'android' && { - headerCenter: () => - }), headerLeft: () => navigation.pop(1)} /> })} /> @@ -64,9 +58,14 @@ const TabMe = React.memo( component={TabMeFavourites} options={({ navigation }: any) => ({ title: t('me.stacks.favourites.name'), - ...(Platform.OS === 'android' && { - headerCenter: () => - }), + headerLeft: () => navigation.pop(1)} /> + })} + /> + ({ + title: t('me.stacks.followedTags.name'), headerLeft: () => navigation.pop(1)} /> })} /> @@ -75,15 +74,6 @@ const TabMe = React.memo( component={TabMeList} options={({ route, navigation }: any) => ({ title: t('me.stacks.list.name', { list: route.params.title }), - ...(Platform.OS === 'android' && { - headerCenter: () => ( - - ) - }), headerLeft: () => navigation.pop(1)} /> })} /> @@ -92,9 +82,6 @@ const TabMe = React.memo( component={TabMeListAccounts} options={({ navigation, route: { params } }) => ({ title: t('me.stacks.listAccounts.name', { list: params.title }), - ...(Platform.OS === 'android' && { - headerCenter: () => - }), headerLeft: () => navigation.pop(1)} /> })} /> @@ -111,9 +98,6 @@ const TabMe = React.memo( component={TabMeListList} options={({ navigation }: any) => ({ title: t('me.stacks.lists.name'), - ...(Platform.OS === 'android' && { - headerCenter: () => - }), headerLeft: () => navigation.pop(1)} /> })} /> @@ -130,9 +114,6 @@ const TabMe = React.memo( component={TabMePush} options={({ navigation }) => ({ title: t('me.stacks.push.name'), - ...(Platform.OS === 'android' && { - headerCenter: () => - }), headerLeft: () => navigation.goBack()} /> })} /> @@ -149,9 +130,6 @@ const TabMe = React.memo( component={TabMeSettingsFontsize} options={({ navigation }: any) => ({ title: t('me.stacks.fontSize.name'), - ...(Platform.OS === 'android' && { - headerCenter: () => - }), headerLeft: () => navigation.pop(1)} /> })} /> @@ -160,9 +138,6 @@ const TabMe = React.memo( component={TabMeSettingsLanguage} options={({ navigation }: any) => ({ title: t('me.stacks.language.name'), - ...(Platform.OS === 'android' && { - headerCenter: () => - }), headerLeft: () => navigation.pop(1)} /> })} /> @@ -173,9 +148,6 @@ const TabMe = React.memo( presentation: 'modal', headerShown: true, title: t('me.stacks.switch.name'), - ...(Platform.OS === 'android' && { - headerCenter: () => - }), headerLeft: () => ( navigation.goBack()} /> ) diff --git a/src/screens/Tabs/Me/FollowedTags.tsx b/src/screens/Tabs/Me/FollowedTags.tsx new file mode 100644 index 00000000..32a2af98 --- /dev/null +++ b/src/screens/Tabs/Me/FollowedTags.tsx @@ -0,0 +1,71 @@ +import Button from '@components/Button' +import haptics from '@components/haptics' +import ComponentHashtag from '@components/Hashtag' +import { displayMessage } from '@components/Message' +import ComponentSeparator from '@components/Separator' +import { TabMeStackScreenProps } from '@utils/navigation/navigators' +import { useFollowedTagsQuery, useTagsMutation } from '@utils/queryHooks/tags' +import React, { useEffect } from 'react' +import { useTranslation } from 'react-i18next' +import { FlatList } from 'react-native-gesture-handler' + +const TabMeFollowedTags: React.FC> = ({ + navigation +}) => { + const { t } = useTranslation('screenTabs') + + const { data, fetchNextPage, refetch } = useFollowedTagsQuery() + const flattenData = data?.pages ? data.pages.flatMap(page => [...page.body]) : [] + useEffect(() => { + if (flattenData.length === 0) { + navigation.goBack() + } + }, [flattenData.length]) + + const mutation = useTagsMutation({ + onSuccess: () => { + haptics('Light') + refetch() + }, + onError: (err: any, { to }) => { + displayMessage({ + type: 'error', + message: t('common:message.error.message', { + function: to ? t('shared.hashtag.follow') : t('shared.hashtag.unfollow') + }), + ...(err.status && + typeof err.status === 'number' && + err.data && + err.data.error && + typeof err.data.error === 'string' && { + description: err.data.error + }) + }) + } + }) + + return ( + ( + {}} + children={ + )} diff --git a/src/screens/Compose/utils/parseState.ts b/src/screens/Compose/utils/parseState.ts index 688c0e7c..811c3371 100644 --- a/src/screens/Compose/utils/parseState.ts +++ b/src/screens/Compose/utils/parseState.ts @@ -65,6 +65,7 @@ const composeParseState = ( }), ...(params.incomingStatus.media_attachments && { attachments: { + ...(params.type === 'edit' && { disallowEditing: true }), sensitive: params.incomingStatus.sensitive, uploads: params.incomingStatus.media_attachments.map(media => ({ remote: media diff --git a/src/screens/Compose/utils/types.d.ts b/src/screens/Compose/utils/types.d.ts index 3500bee6..f5457e46 100644 --- a/src/screens/Compose/utils/types.d.ts +++ b/src/screens/Compose/utils/types.d.ts @@ -51,6 +51,7 @@ export type ComposeState = { expire: '300' | '1800' | '3600' | '21600' | '86400' | '259200' | '604800' } attachments: { + disallowEditing?: boolean // https://github.com/mastodon/mastodon/pull/20878 sensitive: boolean uploads: ExtendedAttachment[] } @@ -59,8 +60,8 @@ export type ComposeState = { replyToStatus?: Mastodon.Status textInputFocus: { current: 'text' | 'spoiler' - refs: { text: RefObject, spoiler: RefObject } - isFocused: { text: MutableRefObject, spoiler: MutableRefObject } + refs: { text: RefObject; spoiler: RefObject } + isFocused: { text: MutableRefObject; spoiler: MutableRefObject } } } From 1ece7b3fe3a354066c2441d20d0c60b660583614 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sat, 10 Dec 2022 23:24:41 +0100 Subject: [PATCH 6/9] Fixed #541 Mastodon does not offer the functionality to group notifications like Twitter does, therefore the best solution is to collapse more content by default, assuming users roughly remember what they have tooted --- src/components/Timeline/Notifications.tsx | 5 ++++- src/components/Timeline/Shared/Content.tsx | 13 ++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/Timeline/Notifications.tsx b/src/components/Timeline/Notifications.tsx index 04204965..4d7b69a6 100644 --- a/src/components/Timeline/Notifications.tsx +++ b/src/components/Timeline/Notifications.tsx @@ -108,7 +108,10 @@ const TimelineNotifications: React.FC = ({ paddingLeft: highlighted ? 0 : StyleConstants.Avatar.M + StyleConstants.Spacing.S }} > - + diff --git a/src/components/Timeline/Shared/Content.tsx b/src/components/Timeline/Shared/Content.tsx index 5e2578a1..0c187cee 100644 --- a/src/components/Timeline/Shared/Content.tsx +++ b/src/components/Timeline/Shared/Content.tsx @@ -6,10 +6,11 @@ import { useSelector } from 'react-redux' import StatusContext from './Context' export interface Props { + notificationOwnToot?: boolean setSpoilerExpanded?: React.Dispatch> } -const TimelineContent: React.FC = ({ setSpoilerExpanded }) => { +const TimelineContent: React.FC = ({ notificationOwnToot = false, setSpoilerExpanded }) => { const { status, highlighted, disableDetails } = useContext(StatusContext) if (!status || typeof status.content !== 'string' || !status.content.length) return null @@ -38,7 +39,13 @@ const TimelineContent: React.FC = ({ setSpoilerExpanded }) => { emojis={status.emojis} mentions={status.mentions} tags={status.tags} - numberOfLines={instanceAccount.preferences['reading:expand:spoilers'] ? 999 : 1} + numberOfLines={ + instanceAccount.preferences['reading:expand:spoilers'] + ? notificationOwnToot + ? 2 + : 999 + : 1 + } expandHint={t('shared.content.expandHint')} setSpoilerExpanded={setSpoilerExpanded} highlighted={highlighted} @@ -53,7 +60,7 @@ const TimelineContent: React.FC = ({ setSpoilerExpanded }) => { emojis={status.emojis} mentions={status.mentions} tags={status.tags} - numberOfLines={highlighted ? 999 : undefined} + numberOfLines={highlighted ? 999 : notificationOwnToot ? 2 : undefined} disableDetails={disableDetails} /> )} From 44379504ebabdf1a235ff9b73b3f9c533d25df9d Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 11 Dec 2022 01:08:38 +0100 Subject: [PATCH 7/9] Fixed #533 Added trending in the "public" tab --- package.json | 1 - src/@types/app.d.ts | 1 + src/@types/untyped.d.ts | 1 - src/api/instance.ts | 32 +++-- src/components/Timeline.tsx | 62 ++++------ src/components/Timeline/Footer.tsx | 12 +- src/components/Timeline/Refresh.tsx | 141 +++++++++------------- src/i18n/en/screens/tabs.json | 5 +- src/screens/Tabs.tsx | 18 +-- src/screens/Tabs/Local.tsx | 106 ----------------- src/screens/Tabs/Local/Root.tsx | 96 +++++++++++++++ src/screens/Tabs/Local/index.tsx | 18 +++ src/screens/Tabs/Me.tsx | 164 -------------------------- src/screens/Tabs/Me/List/Accounts.tsx | 4 +- src/screens/Tabs/Me/index.tsx | 159 +++++++++++++++++++++++++ src/screens/Tabs/Public.tsx | 110 ----------------- src/screens/Tabs/Public/Root.tsx | 84 +++++++++++++ src/screens/Tabs/Public/index.tsx | 18 +++ src/screens/Tabs/Shared/Users.tsx | 3 +- src/utils/queryHooks/lists.ts | 6 +- src/utils/queryHooks/timeline.ts | 58 ++------- src/utils/queryHooks/utils.ts | 2 +- yarn.lock | 5 - 23 files changed, 508 insertions(+), 598 deletions(-) delete mode 100644 src/screens/Tabs/Local.tsx create mode 100644 src/screens/Tabs/Local/Root.tsx create mode 100644 src/screens/Tabs/Local/index.tsx delete mode 100644 src/screens/Tabs/Me.tsx create mode 100644 src/screens/Tabs/Me/index.tsx delete mode 100644 src/screens/Tabs/Public.tsx create mode 100644 src/screens/Tabs/Public/Root.tsx create mode 100644 src/screens/Tabs/Public/index.tsx diff --git a/package.json b/package.json index ec53b8dc..53bef058 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "expo-video-thumbnails": "^7.0.0", "expo-web-browser": "~12.0.0", "i18next": "^22.0.6", - "li": "^1.3.0", "linkify-it": "^4.0.1", "lodash": "^4.17.21", "react": "^18.2.0", diff --git a/src/@types/app.d.ts b/src/@types/app.d.ts index 0db454c2..d3d4f400 100644 --- a/src/@types/app.d.ts +++ b/src/@types/app.d.ts @@ -3,6 +3,7 @@ declare namespace App { | 'Following' | 'Local' | 'LocalPublic' + | 'Trending' | 'Notifications' | 'Hashtag' | 'List' diff --git a/src/@types/untyped.d.ts b/src/@types/untyped.d.ts index e3b7bc1a..25b5f1b1 100644 --- a/src/@types/untyped.d.ts +++ b/src/@types/untyped.d.ts @@ -1,6 +1,5 @@ declare module 'gl-react-blurhash' declare module 'htmlparser2-without-node-native' -declare module 'li' declare module 'react-native-feather' declare module 'react-native-htmlview' declare module 'react-native-toast-message' diff --git a/src/api/instance.ts b/src/api/instance.ts index a178a42c..ca094b4d 100644 --- a/src/api/instance.ts +++ b/src/api/instance.ts @@ -1,6 +1,5 @@ import { RootState } from '@root/store' import axios, { AxiosRequestConfig } from 'axios' -import li from 'li' import { ctx, handleError, userAgent } from './helpers' export type Params = { @@ -15,9 +14,10 @@ export type Params = { extras?: Omit } +type LinkFormat = { id: string; isOffset: boolean } export type InstanceResponse = { body: T - links: { prev?: string; next?: string } + links: { prev?: LinkFormat; next?: LinkFormat } } const apiInstance = async ({ @@ -74,17 +74,27 @@ const apiInstance = async ({ ...extras }) .then(response => { - let prev - let next + let links: { + prev?: { id: string; isOffset: boolean } + next?: { id: string; isOffset: boolean } + } = {} + if (response.headers?.link) { - const headersLinks = li.parse(response.headers?.link) - prev = headersLinks.prev?.match(/_id=([0-9]*)/)?.[1] - next = headersLinks.next?.match(/_id=([0-9]*)/)?.[1] + const linksParsed = response.headers.link.matchAll( + new RegExp('[?&](.*?_id|offset)=(.*?)>; *rel="(.*?)"', 'gi') + ) + for (const link of linksParsed) { + switch (link[3]) { + case 'prev': + links.prev = { id: link[2], isOffset: link[1].includes('offset') } + break + case 'next': + links.next = { id: link[2], isOffset: link[1].includes('offset') } + break + } + } } - return Promise.resolve({ - body: response.data, - links: { prev, next } - }) + return Promise.resolve({ body: response.data, links }) }) .catch(handleError()) } diff --git a/src/components/Timeline.tsx b/src/components/Timeline.tsx index 2f73d636..1b98a665 100644 --- a/src/components/Timeline.tsx +++ b/src/components/Timeline.tsx @@ -6,17 +6,11 @@ import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import React, { RefObject, useCallback, useRef } from 'react' import { FlatList, FlatListProps, Platform, RefreshControl } from 'react-native' -import Animated, { - useAnimatedScrollHandler, - useSharedValue -} from 'react-native-reanimated' +import Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated' import { useSelector } from 'react-redux' import TimelineEmpty from './Timeline/Empty' import TimelineFooter from './Timeline/Footer' -import TimelineRefresh, { - SEPARATION_Y_1, - SEPARATION_Y_2 -} from './Timeline/Refresh' +import TimelineRefresh, { SEPARATION_Y_1, SEPARATION_Y_2 } from './Timeline/Refresh' const AnimatedFlatList = Animated.createAnimatedComponent(FlatList) @@ -26,8 +20,7 @@ export interface Props { disableRefresh?: boolean disableInfinity?: boolean lookback?: Extract - customProps: Partial> & - Pick, 'renderItem'> + customProps: Partial> & Pick, 'renderItem'> } const Timeline: React.FC = ({ @@ -39,30 +32,24 @@ const Timeline: React.FC = ({ }) => { const { colors } = useTheme() - const { - data, - refetch, - isFetching, - isLoading, - fetchNextPage, - isFetchingNextPage - } = useTimelineQuery({ - ...queryKey[1], - options: { - notifyOnChangeProps: Platform.select({ - ios: ['dataUpdatedAt', 'isFetching'], - android: ['dataUpdatedAt', 'isFetching', 'isLoading'] - }), - getNextPageParam: lastPage => - lastPage?.links?.next && { - max_id: lastPage.links.next - } - } - }) + const { data, refetch, isFetching, isLoading, fetchNextPage, isFetchingNextPage } = + useTimelineQuery({ + ...queryKey[1], + options: { + notifyOnChangeProps: Platform.select({ + ios: ['dataUpdatedAt', 'isFetching'], + android: ['dataUpdatedAt', 'isFetching', 'isLoading'] + }), + getNextPageParam: lastPage => + lastPage?.links?.next && { + ...(lastPage.links.next.isOffset + ? { offset: lastPage.links.next.id } + : { max_id: lastPage.links.next.id }) + } + } + }) - const flattenData = data?.pages - ? data.pages?.flatMap(page => [...page.body]) - : [] + const flattenData = data?.pages ? data.pages?.flatMap(page => [...page.body]) : [] const onEndReached = useCallback( () => !disableInfinity && !isFetchingNextPage && fetchNextPage(), @@ -134,10 +121,7 @@ const Timeline: React.FC = ({ onEndReached={onEndReached} onEndReachedThreshold={0.75} ListFooterComponent={ - + } ListEmptyComponent={} ItemSeparatorComponent={({ leadingItem }) => @@ -145,9 +129,7 @@ const Timeline: React.FC = ({ ) : ( ) } diff --git a/src/components/Timeline/Footer.tsx b/src/components/Timeline/Footer.tsx index ab4e1934..4ac3f2af 100644 --- a/src/components/Timeline/Footer.tsx +++ b/src/components/Timeline/Footer.tsx @@ -21,7 +21,11 @@ const TimelineFooter = React.memo( enabled: !disableInfinity, notifyOnChangeProps: ['hasNextPage'], getNextPageParam: lastPage => - lastPage?.links?.next && { max_id: lastPage.links.next } + lastPage?.links?.next && { + ...(lastPage.links.next.isOffset + ? { offset: lastPage.links.next.id } + : { max_id: lastPage.links.next.id }) + } } }) @@ -43,11 +47,7 @@ const TimelineFooter = React.memo( + ]} /> diff --git a/src/components/Timeline/Refresh.tsx b/src/components/Timeline/Refresh.tsx index 8ddfd52f..9ac45e95 100644 --- a/src/components/Timeline/Refresh.tsx +++ b/src/components/Timeline/Refresh.tsx @@ -1,10 +1,6 @@ import haptics from '@components/haptics' import Icon from '@components/Icon' -import { - QueryKeyTimeline, - TimelineData, - useTimelineQuery -} from '@utils/queryHooks/timeline' +import { QueryKeyTimeline, TimelineData, useTimelineQuery } from '@utils/queryHooks/timeline' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import React, { RefObject, useCallback, useRef, useState } from 'react' @@ -31,14 +27,8 @@ export interface Props { } const CONTAINER_HEIGHT = StyleConstants.Spacing.M * 2.5 -export const SEPARATION_Y_1 = -( - CONTAINER_HEIGHT / 2 + - StyleConstants.Font.Size.S / 2 -) -export const SEPARATION_Y_2 = -( - CONTAINER_HEIGHT * 1.5 + - StyleConstants.Font.Size.S / 2 -) +export const SEPARATION_Y_1 = -(CONTAINER_HEIGHT / 2 + StyleConstants.Font.Size.S / 2) +export const SEPARATION_Y_2 = -(CONTAINER_HEIGHT * 1.5 + StyleConstants.Font.Size.S / 2) const TimelineRefresh: React.FC = ({ flRef, @@ -57,87 +47,77 @@ const TimelineRefresh: React.FC = ({ const fetchingLatestIndex = useRef(0) const refetchActive = useRef(false) - const { - refetch, - isFetching, - isLoading, - fetchPreviousPage, - hasPreviousPage, - isFetchingNextPage - } = useTimelineQuery({ - ...queryKey[1], - options: { - getPreviousPageParam: firstPage => - firstPage?.links?.prev && { - min_id: firstPage.links.prev, - // https://github.com/facebook/react-native/issues/25239#issuecomment-731100372 - limit: '3' + const { refetch, isFetching, isLoading, fetchPreviousPage, hasPreviousPage, isFetchingNextPage } = + useTimelineQuery({ + ...queryKey[1], + options: { + getPreviousPageParam: firstPage => + firstPage?.links?.prev && { + ...(firstPage.links.prev.isOffset + ? { offset: firstPage.links.prev.id } + : { max_id: firstPage.links.prev.id }), + // https://github.com/facebook/react-native/issues/25239#issuecomment-731100372 + limit: '3' + }, + select: data => { + if (refetchActive.current) { + data.pageParams = [data.pageParams[0]] + data.pages = [data.pages[0]] + refetchActive.current = false + } + return data }, - select: data => { - if (refetchActive.current) { - data.pageParams = [data.pageParams[0]] - data.pages = [data.pages[0]] - refetchActive.current = false - } - return data - }, - onSuccess: () => { - if (fetchingLatestIndex.current > 0) { - if (fetchingLatestIndex.current > 5) { - clearFirstPage() - fetchingLatestIndex.current = 0 - } else { - if (hasPreviousPage) { - fetchPreviousPage() - fetchingLatestIndex.current++ - } else { + onSuccess: () => { + if (fetchingLatestIndex.current > 0) { + if (fetchingLatestIndex.current > 5) { clearFirstPage() fetchingLatestIndex.current = 0 + } else { + if (hasPreviousPage) { + fetchPreviousPage() + fetchingLatestIndex.current++ + } else { + clearFirstPage() + fetchingLatestIndex.current = 0 + } } } } } - } - }) + }) const { t } = useTranslation('componentTimeline') const { colors } = useTheme() const queryClient = useQueryClient() const clearFirstPage = () => { - queryClient.setQueryData | undefined>( - queryKey, - data => { - if (data?.pages[0] && data.pages[0].body.length === 0) { - return { - pages: data.pages.slice(1), - pageParams: data.pageParams.slice(1) - } - } else { - return data + queryClient.setQueryData | undefined>(queryKey, data => { + if (data?.pages[0] && data.pages[0].body.length === 0) { + return { + pages: data.pages.slice(1), + pageParams: data.pageParams.slice(1) } + } else { + return data } - ) + }) } const prepareRefetch = () => { refetchActive.current = true - queryClient.setQueryData | undefined>( - queryKey, - data => { - if (data) { - data.pageParams = [undefined] - const newFirstPage: TimelineData = { body: [] } - for (let page of data.pages) { - // @ts-ignore - newFirstPage.body.push(...page.body) - if (newFirstPage.body.length > 10) break - } - data.pages = [newFirstPage] + queryClient.setQueryData | undefined>(queryKey, data => { + if (data) { + data.pageParams = [undefined] + const newFirstPage: TimelineData = { body: [] } + for (let page of data.pages) { + // @ts-ignore + newFirstPage.body.push(...page.body) + if (newFirstPage.body.length > 10) break } - - return data + data.pages = [newFirstPage] } - ) + + return data + }) } const callRefetch = async () => { await refetch() @@ -161,10 +141,7 @@ const TimelineRefresh: React.FC = ({ ] })) const arrowTop = useAnimatedStyle(() => ({ - marginTop: - scrollY.value < SEPARATION_Y_2 - ? withTiming(CONTAINER_HEIGHT) - : withTiming(0) + marginTop: scrollY.value < SEPARATION_Y_2 ? withTiming(CONTAINER_HEIGHT) : withTiming(0) })) const arrowStage = useSharedValue(0) @@ -241,8 +218,7 @@ const TimelineRefresh: React.FC = ({ const headerPadding = useAnimatedStyle( () => ({ paddingTop: - fetchingLatestIndex.current !== 0 || - (isFetching && !isLoading && !isFetchingNextPage) + fetchingLatestIndex.current !== 0 || (isFetching && !isLoading && !isFetchingNextPage) ? withTiming(StyleConstants.Spacing.M * 2.5) : withTiming(0) }), @@ -254,10 +230,7 @@ const TimelineRefresh: React.FC = ({ {isFetching ? ( - + ) : ( <> diff --git a/src/i18n/en/screens/tabs.json b/src/i18n/en/screens/tabs.json index 409ac790..fe32807e 100644 --- a/src/i18n/en/screens/tabs.json +++ b/src/i18n/en/screens/tabs.json @@ -6,8 +6,9 @@ "public": { "name": "", "segments": { - "left": "Federated", - "right": "Local" + "federated": "Federated", + "local": "Local", + "trending": "Trending" } }, "notifications": { diff --git a/src/screens/Tabs.tsx b/src/screens/Tabs.tsx index d8f50cc9..f0b2ce9f 100644 --- a/src/screens/Tabs.tsx +++ b/src/screens/Tabs.tsx @@ -3,16 +3,10 @@ import haptics from '@components/haptics' import Icon from '@components/Icon' import { createBottomTabNavigator } from '@react-navigation/bottom-tabs' import { useAppDispatch } from '@root/store' -import { - RootStackScreenProps, - ScreenTabsStackParamList -} from '@utils/navigation/navigators' -import { getPreviousTab } from '@utils/slices/contextsSlice' -import { - getInstanceAccount, - getInstanceActive -} from '@utils/slices/instancesSlice' +import { RootStackScreenProps, ScreenTabsStackParamList } from '@utils/navigation/navigators' import { getVersionUpdate, retrieveVersionLatest } from '@utils/slices/appSlice' +import { getPreviousTab } from '@utils/slices/contextsSlice' +import { getInstanceAccount, getInstanceActive } from '@utils/slices/instancesSlice' import { useTheme } from '@utils/styles/ThemeManager' import React, { useCallback, useEffect, useMemo } from 'react' import { Platform } from 'react-native' @@ -125,11 +119,7 @@ const ScreenTabs = React.memo( > - + () - -const TabLocal = React.memo( - ({ navigation }: ScreenTabsScreenProps<'Tab-Local'>) => { - const { t } = useTranslation('screenTabs') - - const { data: lists } = useListsQuery({}) - - const [queryKey, setQueryKey] = useState(['Timeline', { page: 'Following' }]) - - usePopToTop() - - return ( - - ( - - - 0} - content={ - queryKey[1].page === 'List' && queryKey[1].list?.length - ? lists?.find(list => list.id === queryKey[1].list)?.title - : t('tabs.local.name') - } - /> - - - - {lists?.length - ? [ - { - key: 'default', - item: { - onSelect: () => setQueryKey(['Timeline', { page: 'Following' }]), - disabled: queryKey[1].page === 'Following', - destructive: false, - hidden: false - }, - title: t('tabs.local.name'), - icon: '' - }, - ...lists?.map(list => ({ - key: list.id, - item: { - onSelect: () => - setQueryKey(['Timeline', { page: 'List', list: list.id }]), - disabled: queryKey[1].page === 'List' && queryKey[1].list === list.id, - destructive: false, - hidden: false - }, - title: list.title, - icon: '' - })) - ].map(menu => ( - - - - - )) - : undefined} - - - ), - headerRight: () => ( - navigation.navigate('Tab-Local', { screen: 'Tab-Shared-Search' })} - /> - ) - }} - children={() => ( - - }} - /> - )} - /> - {TabShared({ Stack })} - - ) - }, - () => true -) - -export default TabLocal diff --git a/src/screens/Tabs/Local/Root.tsx b/src/screens/Tabs/Local/Root.tsx new file mode 100644 index 00000000..f3da4ff4 --- /dev/null +++ b/src/screens/Tabs/Local/Root.tsx @@ -0,0 +1,96 @@ +import { HeaderCenter, HeaderRight } from '@components/Header' +import Timeline from '@components/Timeline' +import TimelineDefault from '@components/Timeline/Default' +import { NativeStackScreenProps } from '@react-navigation/native-stack' +import { TabLocalStackParamList } from '@utils/navigation/navigators' +import usePopToTop from '@utils/navigation/usePopToTop' +import { useListsQuery } from '@utils/queryHooks/lists' +import { QueryKeyTimeline } from '@utils/queryHooks/timeline' +import { useEffect, useState } from 'react' +import { useTranslation } from 'react-i18next' +import * as DropdownMenu from 'zeego/dropdown-menu' + +const Root: React.FC> = ({ + navigation +}) => { + const { t } = useTranslation('screenTabs') + + const { data: lists } = useListsQuery() + + const [queryKey, setQueryKey] = useState(['Timeline', { page: 'Following' }]) + + useEffect(() => { + navigation.setOptions({ + headerTitle: () => ( + + + 0} + content={ + queryKey[1].page === 'List' && queryKey[1].list?.length + ? lists?.find(list => list.id === queryKey[1].list)?.title + : t('tabs.local.name') + } + /> + + + + {lists?.length + ? [ + { + key: 'default', + item: { + onSelect: () => setQueryKey(['Timeline', { page: 'Following' }]), + disabled: queryKey[1].page === 'Following', + destructive: false, + hidden: false + }, + title: t('tabs.local.name'), + icon: '' + }, + ...lists?.map(list => ({ + key: list.id, + item: { + onSelect: () => setQueryKey(['Timeline', { page: 'List', list: list.id }]), + disabled: queryKey[1].page === 'List' && queryKey[1].list === list.id, + destructive: false, + hidden: false + }, + title: list.title, + icon: '' + })) + ].map(menu => ( + + + + + )) + : undefined} + + + ), + headerRight: () => ( + navigation.navigate('Tab-Shared-Search')} + /> + ) + }) + }, []) + + usePopToTop() + + return ( + + }} + /> + ) +} + +export default Root diff --git a/src/screens/Tabs/Local/index.tsx b/src/screens/Tabs/Local/index.tsx new file mode 100644 index 00000000..ea78dcbe --- /dev/null +++ b/src/screens/Tabs/Local/index.tsx @@ -0,0 +1,18 @@ +import { createNativeStackNavigator } from '@react-navigation/native-stack' +import { TabLocalStackParamList } from '@utils/navigation/navigators' +import React from 'react' +import TabShared from '../Shared' +import Root from './Root' + +const Stack = createNativeStackNavigator() + +const TabLocal: React.FC = () => { + return ( + + + {TabShared({ Stack })} + + ) +} + +export default TabLocal diff --git a/src/screens/Tabs/Me.tsx b/src/screens/Tabs/Me.tsx deleted file mode 100644 index 870bd7ca..00000000 --- a/src/screens/Tabs/Me.tsx +++ /dev/null @@ -1,164 +0,0 @@ -import { HeaderLeft } from '@components/Header' -import { createNativeStackNavigator } from '@react-navigation/native-stack' -import { TabMeStackParamList } from '@utils/navigation/navigators' -import React from 'react' -import { useTranslation } from 'react-i18next' -import TabMeBookmarks from './Me/Bookmarks' -import TabMeConversations from './Me/Cconversations' -import TabMeFavourites from './Me/Favourites' -import TabMeFollowedTags from './Me/FollowedTags' -import TabMeList from './Me/List' -import TabMeListAccounts from './Me/List/Accounts' -import TabMeListEdit from './Me/List/Edit' -import TabMeListList from './Me/List/List' -import TabMeProfile from './Me/Profile' -import TabMePush from './Me/Push' -import TabMeRoot from './Me/Root' -import TabMeSettings from './Me/Settings' -import TabMeSettingsFontsize from './Me/SettingsFontsize' -import TabMeSettingsLanguage from './Me/SettingsLanguage' -import TabMeSwitch from './Me/Switch' -import TabShared from './Shared' - -const Stack = createNativeStackNavigator() - -const TabMe = React.memo( - () => { - const { t } = useTranslation('screenTabs') - - return ( - - - ({ - title: t('me.stacks.bookmarks.name'), - headerLeft: () => navigation.pop(1)} /> - })} - /> - ({ - title: t('me.stacks.conversations.name'), - headerLeft: () => navigation.pop(1)} /> - })} - /> - ({ - title: t('me.stacks.favourites.name'), - headerLeft: () => navigation.pop(1)} /> - })} - /> - ({ - title: t('me.stacks.followedTags.name'), - headerLeft: () => navigation.pop(1)} /> - })} - /> - ({ - title: t('me.stacks.list.name', { list: route.params.title }), - headerLeft: () => navigation.pop(1)} /> - })} - /> - ({ - title: t('me.stacks.listAccounts.name', { list: params.title }), - headerLeft: () => navigation.pop(1)} /> - })} - /> - - ({ - title: t('me.stacks.lists.name'), - headerLeft: () => navigation.pop(1)} /> - })} - /> - - ({ - title: t('me.stacks.push.name'), - headerLeft: () => navigation.goBack()} /> - })} - /> - ({ - title: t('me.stacks.settings.name'), - headerLeft: () => navigation.pop(1)} /> - })} - /> - ({ - title: t('me.stacks.fontSize.name'), - headerLeft: () => navigation.pop(1)} /> - })} - /> - ({ - title: t('me.stacks.language.name'), - headerLeft: () => navigation.pop(1)} /> - })} - /> - ({ - presentation: 'modal', - headerShown: true, - title: t('me.stacks.switch.name'), - headerLeft: () => ( - navigation.goBack()} /> - ) - })} - /> - - {TabShared({ Stack })} - - ) - }, - () => true -) - -export default TabMe diff --git a/src/screens/Tabs/Me/List/Accounts.tsx b/src/screens/Tabs/Me/List/Accounts.tsx index e3b35678..89465612 100644 --- a/src/screens/Tabs/Me/List/Accounts.tsx +++ b/src/screens/Tabs/Me/List/Accounts.tsx @@ -27,7 +27,9 @@ const TabMeListAccounts: React.FC> options: { getNextPageParam: lastPage => lastPage?.links?.next && { - max_id: lastPage.links.next + ...(lastPage.links.next.isOffset + ? { offset: lastPage.links.next.id } + : { max_id: lastPage.links.next.id }) } } }) diff --git a/src/screens/Tabs/Me/index.tsx b/src/screens/Tabs/Me/index.tsx new file mode 100644 index 00000000..b42e9ee7 --- /dev/null +++ b/src/screens/Tabs/Me/index.tsx @@ -0,0 +1,159 @@ +import { HeaderLeft } from '@components/Header' +import { createNativeStackNavigator } from '@react-navigation/native-stack' +import { TabMeStackParamList } from '@utils/navigation/navigators' +import React from 'react' +import { useTranslation } from 'react-i18next' +import TabMeBookmarks from './Bookmarks' +import TabMeConversations from './Cconversations' +import TabMeFavourites from './Favourites' +import TabMeFollowedTags from './FollowedTags' +import TabMeList from './List' +import TabMeListAccounts from './List/Accounts' +import TabMeListEdit from './List/Edit' +import TabMeListList from './List/List' +import TabMeProfile from './Profile' +import TabMePush from './Push' +import TabMeRoot from './Root' +import TabMeSettings from './Settings' +import TabMeSettingsFontsize from './SettingsFontsize' +import TabMeSettingsLanguage from './SettingsLanguage' +import TabMeSwitch from './Switch' +import TabShared from '../Shared' + +const Stack = createNativeStackNavigator() + +const TabMe: React.FC = () => { + const { t } = useTranslation('screenTabs') + + return ( + + + ({ + title: t('me.stacks.bookmarks.name'), + headerLeft: () => navigation.pop(1)} /> + })} + /> + ({ + title: t('me.stacks.conversations.name'), + headerLeft: () => navigation.pop(1)} /> + })} + /> + ({ + title: t('me.stacks.favourites.name'), + headerLeft: () => navigation.pop(1)} /> + })} + /> + ({ + title: t('me.stacks.followedTags.name'), + headerLeft: () => navigation.pop(1)} /> + })} + /> + ({ + title: t('me.stacks.list.name', { list: route.params.title }), + headerLeft: () => navigation.pop(1)} /> + })} + /> + ({ + title: t('me.stacks.listAccounts.name', { list: params.title }), + headerLeft: () => navigation.pop(1)} /> + })} + /> + + ({ + title: t('me.stacks.lists.name'), + headerLeft: () => navigation.pop(1)} /> + })} + /> + + ({ + title: t('me.stacks.push.name'), + headerLeft: () => navigation.goBack()} /> + })} + /> + ({ + title: t('me.stacks.settings.name'), + headerLeft: () => navigation.pop(1)} /> + })} + /> + ({ + title: t('me.stacks.fontSize.name'), + headerLeft: () => navigation.pop(1)} /> + })} + /> + ({ + title: t('me.stacks.language.name'), + headerLeft: () => navigation.pop(1)} /> + })} + /> + ({ + presentation: 'modal', + headerShown: true, + title: t('me.stacks.switch.name'), + headerLeft: () => navigation.goBack()} /> + })} + /> + + {TabShared({ Stack })} + + ) +} + +export default TabMe diff --git a/src/screens/Tabs/Public.tsx b/src/screens/Tabs/Public.tsx deleted file mode 100644 index 8865623e..00000000 --- a/src/screens/Tabs/Public.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import { HeaderRight } from '@components/Header' -import Timeline from '@components/Timeline' -import TimelineDefault from '@components/Timeline/Default' -import SegmentedControl from '@react-native-community/segmented-control' -import { createNativeStackNavigator } from '@react-navigation/native-stack' -import { ScreenTabsScreenProps, TabPublicStackParamList } from '@utils/navigation/navigators' -import usePopToTop from '@utils/navigation/usePopToTop' -import { QueryKeyTimeline } from '@utils/queryHooks/timeline' -import { useTheme } from '@utils/styles/ThemeManager' -import React, { useCallback, useMemo, useState } from 'react' -import { useTranslation } from 'react-i18next' -import { Dimensions } from 'react-native' -import { TabView } from 'react-native-tab-view' -import TabShared from './Shared' - -const Stack = createNativeStackNavigator() - -const TabPublic = React.memo( - ({ navigation }: ScreenTabsScreenProps<'Tab-Public'>) => { - const { t, i18n } = useTranslation('screenTabs') - const { mode, theme } = useTheme() - - const [segment, setSegment] = useState(0) - const pages: { - title: string - key: Extract - }[] = [ - { - title: t('tabs.public.segments.left'), - key: 'LocalPublic' - }, - { - title: t('tabs.public.segments.right'), - key: 'Local' - } - ] - const screenOptionsRoot = useMemo( - () => ({ - headerTitle: () => ( - p.title)} - selectedIndex={segment} - onChange={({ nativeEvent }) => setSegment(nativeEvent.selectedSegmentIndex)} - style={{ flexBasis: '65%' }} - /> - ), - headerRight: () => ( - navigation.navigate('Tab-Public', { screen: 'Tab-Shared-Search' })} - /> - ) - }), - [theme, segment, i18n.language] - ) - - const routes = pages.map(p => ({ key: p.key })) - - const renderScene = useCallback( - ({ - route: { key: page } - }: { - route: { - key: Extract - } - }) => { - const queryKey: QueryKeyTimeline = ['Timeline', { page }] - return ( - - }} - /> - ) - }, - [] - ) - const children = useCallback( - () => ( - null} - onIndexChange={index => setSegment(index)} - navigationState={{ index: segment, routes }} - initialLayout={{ width: Dimensions.get('screen').width }} - /> - ), - [segment] - ) - - usePopToTop() - - return ( - - - {TabShared({ Stack })} - - ) - }, - () => true -) - -export default TabPublic diff --git a/src/screens/Tabs/Public/Root.tsx b/src/screens/Tabs/Public/Root.tsx new file mode 100644 index 00000000..4451ea11 --- /dev/null +++ b/src/screens/Tabs/Public/Root.tsx @@ -0,0 +1,84 @@ +import { HeaderRight } from '@components/Header' +import Timeline from '@components/Timeline' +import TimelineDefault from '@components/Timeline/Default' +import SegmentedControl from '@react-native-community/segmented-control' +import { NativeStackScreenProps } from '@react-navigation/native-stack' +import { TabPublicStackParamList } from '@utils/navigation/navigators' +import usePopToTop from '@utils/navigation/usePopToTop' +import { QueryKeyTimeline } from '@utils/queryHooks/timeline' +import { useTheme } from '@utils/styles/ThemeManager' +import { useEffect, useState } from 'react' +import { useTranslation } from 'react-i18next' +import { Dimensions } from 'react-native' +import { SceneMap, TabView } from 'react-native-tab-view' + +const Route = ({ route: { key: page } }: { route: any }) => { + const queryKey: QueryKeyTimeline = ['Timeline', { page }] + return ( + + }} + /> + ) +} + +const renderScene = SceneMap({ + Local: Route, + LocalPublic: Route, + Trending: Route +}) + +const Root: React.FC> = ({ + navigation +}) => { + const { mode } = useTheme() + const { t } = useTranslation('screenTabs') + + const [segment, setSegment] = useState(0) + const [routes] = useState([ + { key: 'Local', title: t('tabs.public.segments.local') }, + { key: 'LocalPublic', title: t('tabs.public.segments.federated') }, + { key: 'Trending', title: t('tabs.public.segments.trending') } + ]) + + useEffect(() => { + navigation.setOptions({ + headerTitle: () => ( + title)} + selectedIndex={segment} + onChange={({ nativeEvent }) => setSegment(nativeEvent.selectedSegmentIndex)} + style={{ flexBasis: '65%' }} + /> + ), + headerRight: () => ( + navigation.navigate('Tab-Shared-Search')} + /> + ) + }) + }, [mode, segment]) + + usePopToTop() + + return ( + null} + onIndexChange={index => setSegment(index)} + navigationState={{ index: segment, routes }} + initialLayout={{ width: Dimensions.get('screen').width }} + /> + ) +} + +export default Root diff --git a/src/screens/Tabs/Public/index.tsx b/src/screens/Tabs/Public/index.tsx new file mode 100644 index 00000000..f857db98 --- /dev/null +++ b/src/screens/Tabs/Public/index.tsx @@ -0,0 +1,18 @@ +import { createNativeStackNavigator } from '@react-navigation/native-stack' +import { TabPublicStackParamList } from '@utils/navigation/navigators' +import React from 'react' +import TabShared from '../Shared' +import Root from './Root' + +const Stack = createNativeStackNavigator() + +const TabPublic: React.FC = () => { + return ( + + + {TabShared({ Stack })} + + ) +} + +export default TabPublic diff --git a/src/screens/Tabs/Shared/Users.tsx b/src/screens/Tabs/Shared/Users.tsx index d1a6fdf7..53aa4b25 100644 --- a/src/screens/Tabs/Shared/Users.tsx +++ b/src/screens/Tabs/Shared/Users.tsx @@ -23,8 +23,7 @@ const TabSharedUsers: React.FC> = const { data, hasNextPage, fetchNextPage, isFetchingNextPage } = useUsersQuery({ ...queryKey[1], options: { - getPreviousPageParam: firstPage => - firstPage.links?.prev && { since_id: firstPage.links.next }, + getPreviousPageParam: firstPage => firstPage.links?.prev && { min_id: firstPage.links.next }, getNextPageParam: lastPage => lastPage.links?.next && { max_id: lastPage.links.next } } }) diff --git a/src/utils/queryHooks/lists.ts b/src/utils/queryHooks/lists.ts index e23c38f1..0f7f0b81 100644 --- a/src/utils/queryHooks/lists.ts +++ b/src/utils/queryHooks/lists.ts @@ -20,9 +20,11 @@ const queryFunction = async () => { return res.body } -const useListsQuery = ({ options }: { options?: UseQueryOptions }) => { +const useListsQuery = ( + params: { options?: UseQueryOptions } | void +) => { const queryKey: QueryKeyLists = ['Lists'] - return useQuery(queryKey, queryFunction, options) + return useQuery(queryKey, queryFunction, params?.options) } type MutationVarsLists = diff --git a/src/utils/queryHooks/timeline.ts b/src/utils/queryHooks/timeline.ts index 3c285b50..17f811df 100644 --- a/src/utils/queryHooks/timeline.ts +++ b/src/utils/queryHooks/timeline.ts @@ -40,6 +40,7 @@ const queryFunction = async ({ queryKey, pageParam }: QueryFunctionContext({ method: 'get', url: 'timelines/public', @@ -56,6 +57,14 @@ const queryFunction = async ({ queryKey, pageParam }: QueryFunctionContext({ + method: 'get', + url: 'trends/statuses', + params + }) + case 'Notifications': const rootStore = store.getState() const notificationsFilter = getInstanceNotificationsFilter(rootStore) @@ -206,53 +215,6 @@ const useTimelineQuery = ({ }) } -const prefetchTimelineQuery = async ({ - ids, - queryKey -}: { - ids: Mastodon.Status['id'][] - queryKey: QueryKeyTimeline -}): Promise => { - let page: string = '' - let local: boolean = false - switch (queryKey[1].page) { - case 'Following': - page = 'home' - break - case 'Local': - page = 'public' - local = true - break - case 'LocalPublic': - page = 'public' - break - } - - for (const id of ids) { - const statuses = await apiInstance({ - method: 'get', - url: `timelines/${page}`, - params: { - min_id: id, - limit: 1, - ...(local && { local: 'true' }) - } - }) - if (statuses.body.length) { - await queryClient.prefetchInfiniteQuery(queryKey, props => - queryFunction({ - ...props, - queryKey, - pageParam: { - max_id: statuses.body[0].id - } - }) - ) - return id - } - } -} - // --- Separator --- enum MapPropertyToUrl { @@ -460,4 +422,4 @@ const useTimelineMutation = ({ }) } -export { prefetchTimelineQuery, useTimelineQuery, useTimelineMutation } +export { useTimelineQuery, useTimelineMutation } diff --git a/src/utils/queryHooks/utils.ts b/src/utils/queryHooks/utils.ts index 25e12ae1..5b57931b 100644 --- a/src/utils/queryHooks/utils.ts +++ b/src/utils/queryHooks/utils.ts @@ -2,7 +2,7 @@ import { InstanceResponse } from '@api/instance' export const infinitePageParams = { getPreviousPageParam: (firstPage: InstanceResponse) => - firstPage.links?.prev && { since_id: firstPage.links.next }, + firstPage.links?.prev && { min_id: firstPage.links.next }, getNextPageParam: (lastPage: InstanceResponse) => lastPage.links?.next && { max_id: lastPage.links.next } } diff --git a/yarn.lock b/yarn.lock index 325dcbf9..e40a5cab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8144,11 +8144,6 @@ leven@^3.1.0: resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== -li@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/li/-/li-1.3.0.tgz#22c59bcaefaa9a8ef359cf759784e4bf106aea1b" - integrity sha512-z34TU6GlMram52Tss5mt1m//ifRIpKH5Dqm7yUVOdHI+BQCs9qGPHFaCUTIzsWX7edN30aa2WrPwR7IO10FHaw== - lie@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" From 73eb695cfc38f44ef3be22fe1d4ea7b9bdab689b Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 11 Dec 2022 01:37:26 +0100 Subject: [PATCH 8/9] Fixed #538 --- fastlane/metadata/en-US/release_notes.txt | 1 + fastlane/metadata/zh-Hans/release_notes.txt | 1 + src/screens/Tabs/Public/Root.tsx | 16 ++++++- src/startup/dev.ts | 5 --- src/store.ts | 8 ++-- src/utils/migrations/contexts/migration.ts | 6 +++ src/utils/migrations/contexts/v3.ts | 19 ++++++++ src/utils/slices/contextsSlice.ts | 48 +++++++-------------- 8 files changed, 61 insertions(+), 43 deletions(-) create mode 100644 src/utils/migrations/contexts/v3.ts diff --git a/fastlane/metadata/en-US/release_notes.txt b/fastlane/metadata/en-US/release_notes.txt index 103e95c2..492ae4bc 100644 --- a/fastlane/metadata/en-US/release_notes.txt +++ b/fastlane/metadata/en-US/release_notes.txt @@ -1,5 +1,6 @@ Enjoy toooting! This version includes following improvements and fixes: - Automatic setting detected language when tooting +- Remember public timeline type selection - Added notification for admins - Fix whole word filter matching - Fix tablet cannot delete toot drafts \ No newline at end of file diff --git a/fastlane/metadata/zh-Hans/release_notes.txt b/fastlane/metadata/zh-Hans/release_notes.txt index b7098afa..4e3b5ced 100644 --- a/fastlane/metadata/zh-Hans/release_notes.txt +++ b/fastlane/metadata/zh-Hans/release_notes.txt @@ -1,5 +1,6 @@ toooting愉快!此版本包括以下改进和修复: - 自动识别发嘟语言 +- 记住上次公共时间轴选项 - 新增管理员推送通知 - 修复过滤整词功能 - 修复平板不能删除草稿 \ No newline at end of file diff --git a/src/screens/Tabs/Public/Root.tsx b/src/screens/Tabs/Public/Root.tsx index 4451ea11..c1c07284 100644 --- a/src/screens/Tabs/Public/Root.tsx +++ b/src/screens/Tabs/Public/Root.tsx @@ -3,14 +3,18 @@ import Timeline from '@components/Timeline' import TimelineDefault from '@components/Timeline/Default' import SegmentedControl from '@react-native-community/segmented-control' import { NativeStackScreenProps } from '@react-navigation/native-stack' +import { useAppDispatch } from '@root/store' +import { ContextsLatest } from '@utils/migrations/contexts/migration' import { TabPublicStackParamList } from '@utils/navigation/navigators' import usePopToTop from '@utils/navigation/usePopToTop' import { QueryKeyTimeline } from '@utils/queryHooks/timeline' +import { getPreviousSegment, updatePreviousSegment } from '@utils/slices/contextsSlice' import { useTheme } from '@utils/styles/ThemeManager' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { Dimensions } from 'react-native' import { SceneMap, TabView } from 'react-native-tab-view' +import { useSelector } from 'react-redux' const Route = ({ route: { key: page } }: { route: any }) => { const queryKey: QueryKeyTimeline = ['Timeline', { page }] @@ -37,7 +41,12 @@ const Root: React.FC true) + const segments: ContextsLatest['previousSegment'][] = ['Local', 'LocalPublic', 'Trending'] + const [segment, setSegment] = useState( + segments.findIndex(segment => segment === previousSegment) + ) const [routes] = useState([ { key: 'Local', title: t('tabs.public.segments.local') }, { key: 'LocalPublic', title: t('tabs.public.segments.federated') }, @@ -51,7 +60,10 @@ const Root: React.FC title)} selectedIndex={segment} - onChange={({ nativeEvent }) => setSegment(nativeEvent.selectedSegmentIndex)} + onChange={({ nativeEvent }) => { + setSegment(nativeEvent.selectedSegmentIndex) + dispatch(updatePreviousSegment(segments[nativeEvent.selectedSegmentIndex])) + }} style={{ flexBasis: '65%' }} /> ), diff --git a/src/startup/dev.ts b/src/startup/dev.ts index cd00e174..12915585 100644 --- a/src/startup/dev.ts +++ b/src/startup/dev.ts @@ -1,8 +1,3 @@ -/// - -import React from 'react' -import log from './log' - const dev = () => { if (__DEV__) { // log('log', 'devs', 'initializing wdyr') diff --git a/src/store.ts b/src/store.ts index f9725338..7673ea8f 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,11 +1,11 @@ import createSecureStore from '@neverdull-agency/expo-unlimited-secure-store' import AsyncStorage from '@react-native-async-storage/async-storage' import { AnyAction, configureStore, Reducer } from '@reduxjs/toolkit' -import contextsMigration from '@utils/migrations/contexts/migration' +import contextsMigration, { ContextsLatest } from '@utils/migrations/contexts/migration' import instancesMigration from '@utils/migrations/instances/migration' import settingsMigration from '@utils/migrations/settings/migration' import appSlice, { AppState } from '@utils/slices/appSlice' -import contextsSlice, { ContextsState } from '@utils/slices/contextsSlice' +import contextsSlice from '@utils/slices/contextsSlice' import instancesSlice, { InstancesState } from '@utils/slices/instancesSlice' import settingsSlice, { SettingsState } from '@utils/slices/settingsSlice' import { Platform } from 'react-native' @@ -37,7 +37,7 @@ const contextsPersistConfig = { key: 'contexts', prefix, storage: AsyncStorage, - version: 2, + version: 3, // @ts-ignore migrate: createMigrate(contextsMigration) } @@ -64,7 +64,7 @@ const store = configureStore({ reducer: { app: persistReducer(appPersistConfig, appSlice) as Reducer, contexts: persistReducer(contextsPersistConfig, contextsSlice) as Reducer< - ContextsState, + ContextsLatest, AnyAction >, instances: persistReducer(instancesPersistConfig, instancesSlice) as Reducer< diff --git a/src/utils/migrations/contexts/migration.ts b/src/utils/migrations/contexts/migration.ts index 2dedf997..faa57786 100644 --- a/src/utils/migrations/contexts/migration.ts +++ b/src/utils/migrations/contexts/migration.ts @@ -1,6 +1,7 @@ import { ContextsV0 } from './v0' import { ContextsV1 } from './v1' import { ContextsV2 } from './v2' +import { ContextsV3 } from './v3' const contextsMigration = { 1: (state: ContextsV0): ContextsV1 => { @@ -15,7 +16,12 @@ const contextsMigration = { 2: (state: ContextsV1): ContextsV2 => { const { mePage, ...rest } = state return rest + }, + 3: (state: ContextsV2): ContextsV3 => { + return { ...state, previousSegment: 'Local' } } } +export { ContextsV3 as ContextsLatest } + export default contextsMigration diff --git a/src/utils/migrations/contexts/v3.ts b/src/utils/migrations/contexts/v3.ts new file mode 100644 index 00000000..0f35df8b --- /dev/null +++ b/src/utils/migrations/contexts/v3.ts @@ -0,0 +1,19 @@ +import { ScreenTabsStackParamList } from '@utils/navigation/navigators' + +export type ContextsV3 = { + storeReview: { + context: Readonly + current: number + shown: boolean + } + publicRemoteNotice: { + context: Readonly + current: number + hidden: boolean + } + previousTab: Extract< + keyof ScreenTabsStackParamList, + 'Tab-Local' | 'Tab-Public' | 'Tab-Notifications' | 'Tab-Me' + > + previousSegment: Extract +} diff --git a/src/utils/slices/contextsSlice.ts b/src/utils/slices/contextsSlice.ts index 27a4235f..df99bdd6 100644 --- a/src/utils/slices/contextsSlice.ts +++ b/src/utils/slices/contextsSlice.ts @@ -1,23 +1,10 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { RootState } from '@root/store' +import { ContextsLatest } from '@utils/migrations/contexts/migration' import Constants from 'expo-constants' import * as StoreReview from 'expo-store-review' -export type ContextsState = { - storeReview: { - context: Readonly - current: number - shown: boolean - } - publicRemoteNotice: { - context: Readonly - current: number - hidden: boolean - } - previousTab: 'Tab-Local' | 'Tab-Public' | 'Tab-Notifications' | 'Tab-Me' -} - -export const contextsInitialState = { +export const contextsInitialState: ContextsLatest = { // After 10 successful postings storeReview: { context: 10, @@ -30,49 +17,46 @@ export const contextsInitialState = { current: 0, hidden: false }, - previousTab: 'Tab-Me' + previousTab: 'Tab-Me', + previousSegment: 'Local' } const contextsSlice = createSlice({ name: 'contexts', - initialState: contextsInitialState as ContextsState, + initialState: contextsInitialState, reducers: { updateStoreReview: (state, action: PayloadAction<1>) => { if (Constants.expoConfig?.extra?.environment === 'release') { state.storeReview.current = state.storeReview.current + action.payload if (state.storeReview.current === state.storeReview.context) { - StoreReview?.isAvailableAsync().then(() => - StoreReview.requestReview() - ) + StoreReview?.isAvailableAsync().then(() => StoreReview.requestReview()) } } }, updatePublicRemoteNotice: (state, action: PayloadAction<1>) => { - state.publicRemoteNotice.current = - state.publicRemoteNotice.current + action.payload - if ( - state.publicRemoteNotice.current === state.publicRemoteNotice.context - ) { + state.publicRemoteNotice.current = state.publicRemoteNotice.current + action.payload + if (state.publicRemoteNotice.current === state.publicRemoteNotice.context) { state.publicRemoteNotice.hidden = true } }, - updatePreviousTab: ( - state, - action: PayloadAction - ) => { + updatePreviousTab: (state, action: PayloadAction) => { state.previousTab = action.payload + }, + updatePreviousSegment: (state, action: PayloadAction) => { + state.previousSegment = action.payload } } }) -export const getPublicRemoteNotice = (state: RootState) => - state.contexts.publicRemoteNotice +export const getPublicRemoteNotice = (state: RootState) => state.contexts.publicRemoteNotice export const getPreviousTab = (state: RootState) => state.contexts.previousTab +export const getPreviousSegment = (state: RootState) => state.contexts.previousSegment export const getContexts = (state: RootState) => state.contexts export const { updateStoreReview, updatePublicRemoteNotice, - updatePreviousTab + updatePreviousTab, + updatePreviousSegment } = contextsSlice.actions export default contextsSlice.reducer From e542f0a52e05ee5d9f658468c33d5034d5ec53f0 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 11 Dec 2022 01:46:14 +0100 Subject: [PATCH 9/9] Fixed #534 --- src/components/Timeline/Default.tsx | 1 + src/components/Timeline/Shared/Content.tsx | 6 +++--- src/components/Timeline/Shared/Context.tsx | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Timeline/Default.tsx b/src/components/Timeline/Default.tsx index cf57785b..16c8ac90 100644 --- a/src/components/Timeline/Default.tsx +++ b/src/components/Timeline/Default.tsx @@ -125,6 +125,7 @@ const TimelineDefault: React.FC = ({ spoilerHidden, copiableContent, highlighted, + inThread: queryKey?.[1].page === 'Toot', disableDetails, disableOnPress }} diff --git a/src/components/Timeline/Shared/Content.tsx b/src/components/Timeline/Shared/Content.tsx index 0c187cee..85985330 100644 --- a/src/components/Timeline/Shared/Content.tsx +++ b/src/components/Timeline/Shared/Content.tsx @@ -11,7 +11,7 @@ export interface Props { } const TimelineContent: React.FC = ({ notificationOwnToot = false, setSpoilerExpanded }) => { - const { status, highlighted, disableDetails } = useContext(StatusContext) + const { status, highlighted, inThread, disableDetails } = useContext(StatusContext) if (!status || typeof status.content !== 'string' || !status.content.length) return null const { t } = useTranslation('componentTimeline') @@ -40,7 +40,7 @@ const TimelineContent: React.FC = ({ notificationOwnToot = false, setSpoi mentions={status.mentions} tags={status.tags} numberOfLines={ - instanceAccount.preferences['reading:expand:spoilers'] + instanceAccount.preferences['reading:expand:spoilers'] || inThread ? notificationOwnToot ? 2 : 999 @@ -60,7 +60,7 @@ const TimelineContent: React.FC = ({ notificationOwnToot = false, setSpoi emojis={status.emojis} mentions={status.mentions} tags={status.tags} - numberOfLines={highlighted ? 999 : notificationOwnToot ? 2 : undefined} + numberOfLines={highlighted || inThread ? 999 : notificationOwnToot ? 2 : undefined} disableDetails={disableDetails} /> )} diff --git a/src/components/Timeline/Shared/Context.tsx b/src/components/Timeline/Shared/Context.tsx index 5dafee11..7a4db11e 100644 --- a/src/components/Timeline/Shared/Context.tsx +++ b/src/components/Timeline/Shared/Context.tsx @@ -16,6 +16,7 @@ type ContextType = { }> highlighted?: boolean + inThread?: boolean disableDetails?: boolean disableOnPress?: boolean }