Merge branch 'main' into candidate

This commit is contained in:
xmflsct 2023-01-16 14:59:13 +01:00
commit b642070818
23 changed files with 51 additions and 34 deletions

View File

@ -123,7 +123,7 @@
"muted": {
"accessibilityLabel": "Publicació silenciada"
},
"replies": "Respostes <0 />",
"replies": "En resposta a <0 />",
"visibility": {
"direct": {
"accessibilityLabel": "La publicació és un missatge directe"

View File

@ -373,7 +373,8 @@
"hashtags": "Etiqueta",
"statuses": "Publicació"
},
"notFound": "No s'ha trobat <bold>{{searchTerm}}</bold> relacionat {{type}}"
"notFound": "No s'ha trobat <bold>{{searchTerm}}</bold> relacionat {{type}}",
"noResult": "No s'ha trobat res, prova-ho amb un altre terme"
},
"toot": {
"name": "Discussions",

View File

@ -373,7 +373,8 @@
"hashtags": "",
"statuses": ""
},
"notFound": ""
"notFound": "",
"noResult": ""
},
"toot": {
"name": "",

View File

@ -373,7 +373,8 @@
"hashtags": "Hashtag",
"statuses": "Tröt"
},
"notFound": "Konnte <bold>{{searchTerm}}</bold>-bezogene {{type}} nicht finden"
"notFound": "Konnte <bold>{{searchTerm}}</bold>-bezogene {{type}} nicht finden",
"noResult": "Nichts gefunden, bitte versuchen Sie es mit einem anderen Begriff"
},
"toot": {
"name": "Diskussionen",

View File

@ -373,7 +373,8 @@
"hashtags": "Hashtag",
"statuses": "Ανάρτηση"
},
"notFound": "Δεν είναι εφικτό να βρεθεί <bold>{{searchTerm}}</bold> που να έχει σχέση με {{type}}"
"notFound": "Δεν είναι εφικτό να βρεθεί <bold>{{searchTerm}}</bold> που να έχει σχέση με {{type}}",
"noResult": ""
},
"toot": {
"name": "Συζητήσεις",

View File

@ -123,7 +123,7 @@
"muted": {
"accessibilityLabel": "Toot silenciado"
},
"replies": "Respuestas <0 />",
"replies": "En respuesta a <0 />",
"visibility": {
"direct": {
"accessibilityLabel": "El toot es un mensaje directo"

View File

@ -373,7 +373,8 @@
"hashtags": "Hashtag",
"statuses": "Toot"
},
"notFound": "No se pudo encontrar <bold>{{searchTerm}}</bold> relacionado con {{type}}"
"notFound": "No se pudo encontrar <bold>{{searchTerm}}</bold> relacionado con {{type}}",
"noResult": "No se ha podido encontrar nada, por favor, inténtelo con un término diferente"
},
"toot": {
"name": "Discusiones",

View File

@ -373,7 +373,8 @@
"hashtags": "Hashtag",
"statuses": "Pouet"
},
"notFound": "Impossible de trouver <bold>{{searchTerm}}</bold> lié à {{type}}"
"notFound": "Impossible de trouver <bold>{{searchTerm}}</bold> lié à {{type}}",
"noResult": ""
},
"toot": {
"name": "Discussions",

View File

@ -373,7 +373,8 @@
"hashtags": "Hashtag",
"statuses": "Toot"
},
"notFound": "Impossibile trovare <bold>{{searchTerm}}</bold> come {{type}}"
"notFound": "Impossibile trovare <bold>{{searchTerm}}</bold> come {{type}}",
"noResult": ""
},
"toot": {
"name": "Discussioni",

View File

@ -373,7 +373,8 @@
"hashtags": "ハッシュタグ",
"statuses": "投稿"
},
"notFound": "{{type}} <bold>{{searchTerm}}</bold> は見つかりませんでした"
"notFound": "{{type}} <bold>{{searchTerm}}</bold> は見つかりませんでした",
"noResult": ""
},
"toot": {
"name": "スレッド",

View File

@ -373,7 +373,8 @@
"hashtags": "해시태그",
"statuses": "툿"
},
"notFound": "<bold>{{searchTerm}}</bold>와 관련된 {{type}}을 찾을 수 없어요"
"notFound": "<bold>{{searchTerm}}</bold>와 관련된 {{type}}을 찾을 수 없어요",
"noResult": ""
},
"toot": {
"name": "대화",

View File

@ -373,7 +373,8 @@
"hashtags": "Hashtag",
"statuses": "Toot"
},
"notFound": "Kan <bold>{{searchTerm}}</bold> niet vinden gerelateerd aan {{type}}"
"notFound": "Kan <bold>{{searchTerm}}</bold> niet vinden gerelateerd aan {{type}}",
"noResult": "Kan niets vinden, probeer een andere term"
},
"toot": {
"name": "Gesprek",

View File

@ -373,7 +373,8 @@
"hashtags": "Hashtag",
"statuses": "Toot"
},
"notFound": "Nie można odnaleźć <bold>{{searchTerm}}</bold> powiązanego {{type}}"
"notFound": "Nie można odnaleźć <bold>{{searchTerm}}</bold> powiązanego {{type}}",
"noResult": ""
},
"toot": {
"name": "Dyskusje",

View File

@ -373,7 +373,8 @@
"hashtags": "Palavras-chave",
"statuses": "Toot"
},
"notFound": "Não foi possível encontrar <bold>{{searchTerm}}</bold> {{type}} relacionado"
"notFound": "Não foi possível encontrar <bold>{{searchTerm}}</bold> {{type}} relacionado",
"noResult": ""
},
"toot": {
"name": "Discussões",

View File

@ -373,7 +373,8 @@
"hashtags": "",
"statuses": ""
},
"notFound": ""
"notFound": "",
"noResult": ""
},
"toot": {
"name": "",

View File

@ -373,7 +373,8 @@
"hashtags": "Hashtagg",
"statuses": "Inlägg"
},
"notFound": "Kan inte hitta <bold>{{searchTerm}}</bold>-relaterade {{type}}"
"notFound": "Kan inte hitta <bold>{{searchTerm}}</bold>-relaterade {{type}}",
"noResult": ""
},
"toot": {
"name": "Diskussioner",

View File

@ -49,7 +49,7 @@
},
"favourited": {
"accessibilityLabel": "Додати дмух до улюблених",
"function": "Улюблені дмухи"
"function": "Вподобати дмух"
},
"bookmarked": {
"accessibilityLabel": "Додати цей дмух до закладок",

View File

@ -373,7 +373,8 @@
"hashtags": "Ґештег",
"statuses": "Дмух"
},
"notFound": "Не вдалося знайти <bold>{{searchTerm}}</bold> пов'язаний з {{type}}"
"notFound": "Не вдалося знайти <bold>{{searchTerm}}</bold> пов'язаний з {{type}}",
"noResult": "Нічого не знайдено, спробуйте інший термін"
},
"toot": {
"name": "Обговорення",

View File

@ -373,7 +373,8 @@
"hashtags": "Hashtag",
"statuses": "Tút"
},
"notFound": "Không tìm thấy {{type}} <bold>{{searchTerm}}</bold>"
"notFound": "Không tìm thấy {{type}} <bold>{{searchTerm}}</bold>",
"noResult": ""
},
"toot": {
"name": "Nội dung tút",

View File

@ -373,7 +373,8 @@
"hashtags": "话题标签",
"statuses": "嘟文"
},
"notFound": "找不到 <bold>{{searchTerm}}</bold> 相关的 {{type}}"
"notFound": "找不到 <bold>{{searchTerm}}</bold> 相关的 {{type}}",
"noResult": "搜索不到相关信息,请尝试不同关键词"
},
"toot": {
"name": "对话",

View File

@ -373,7 +373,8 @@
"hashtags": "主題標籤",
"statuses": "嘟文"
},
"notFound": "找不到 <bold>{{searchTerm}}</bold> 相關的 {{type}}"
"notFound": "找不到 <bold>{{searchTerm}}</bold> 相關的 {{type}}",
"noResult": "找不到任何東西,請嘗試其它用詞"
},
"toot": {
"name": "討論",

View File

@ -1,8 +1,7 @@
import { HeaderRight } from '@components/Header'
import Timeline from '@components/Timeline'
import SegmentedControl from '@react-native-community/segmented-control'
import { useNavigation } from '@react-navigation/native'
import { NativeStackNavigationProp, NativeStackScreenProps } from '@react-navigation/native-stack'
import { NativeStackScreenProps } from '@react-navigation/native-stack'
import { TabPublicStackParamList } from '@utils/navigation/navigators'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import { getGlobalStorage, setGlobalStorage } from '@utils/storage/actions'
@ -14,12 +13,7 @@ import { Dimensions } from 'react-native'
import { SceneMap, TabView } from 'react-native-tab-view'
const Route = ({ route: { key: page } }: { route: any }) => {
const navigation =
useNavigation<NativeStackNavigationProp<TabPublicStackParamList, 'Tab-Public-Root'>>()
const queryKey: QueryKeyTimeline = ['Timeline', { page }]
useEffect(() => {
navigation.setParams({ queryKey })
}, [])
return <Timeline queryKey={queryKey} disableRefresh={page === 'Trending'} />
}
@ -35,12 +29,11 @@ const Root: React.FC<NativeStackScreenProps<TabPublicStackParamList, 'Tab-Public
const { mode } = useTheme()
const { t } = useTranslation('screenTabs')
const previousSegment = getGlobalStorage.string('app.prev_public_segment')
const segments: StorageGlobal['app.prev_public_segment'][] = ['Local', 'LocalPublic', 'Trending']
const [segment, setSegment] = useState<number>(
Math.max(
0,
segments.findIndex(segment => segment === previousSegment)
segments.findIndex(segment => segment === getGlobalStorage.string('app.prev_public_segment'))
)
)
const [routes] = useState([
@ -48,6 +41,10 @@ const Root: React.FC<NativeStackScreenProps<TabPublicStackParamList, 'Tab-Public
{ key: 'LocalPublic', title: t('tabs.public.segments.federated') },
{ key: 'Trending', title: t('tabs.public.segments.trending') }
])
useEffect(() => {
const page = segments[segment]
page && navigation.setParams({ queryKey: ['Timeline', { page }] })
}, [segment])
useEffect(() => {
navigation.setOptions({

View File

@ -34,7 +34,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
remote: ['Timeline', { page: 'Toot', toot: toot.id, remote: true }]
}
const flRef = useRef<FlatList<Mastodon.Status & { _level?: number }>>(null)
const flRef = useRef<FlatList<Mastodon.Status & { _level?: number; key?: string }>>(null)
useEffect(() => {
navigation.setOptions({
@ -72,11 +72,13 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
}, [hasRemoteContent])
const PREV_PER_BATCH = 1
const ancestorsCache = useRef<(Mastodon.Status & { _level?: number })[]>()
const ancestorsCache = useRef<(Mastodon.Status & { _level?: number; key?: string })[]>()
const loaded = useRef<boolean>(false)
const match = urlMatcher(toot.url || toot.uri)
const query = useQuery<{ pages: { body: (Mastodon.Status & { _level?: number })[] }[] }>(
const query = useQuery<{
pages: { body: (Mastodon.Status & { _level?: number; key?: string })[] }[]
}>(
queryKey.local,
async () => {
const context = await apiInstance<{
@ -109,7 +111,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
}
},
{
placeholderData: { pages: [{ body: [{ ...toot, _level: 0 }] }] },
placeholderData: { pages: [{ body: [{ ...toot, _level: 0, key: `${toot.id}_cache` }] }] },
enabled: !toot._remote,
staleTime: 0,
refetchOnMount: true,