mirror of
https://github.com/tooot-app/app
synced 2025-04-26 16:08:58 +02:00
Fix bugs
This commit is contained in:
parent
76d4bc754b
commit
7f97908e23
@ -14,9 +14,11 @@ const HeaderSharedReplies: React.FC = () => {
|
|||||||
const { t } = useTranslation(['common', 'componentTimeline'])
|
const { t } = useTranslation(['common', 'componentTimeline'])
|
||||||
const { colors } = useTheme()
|
const { colors } = useTheme()
|
||||||
|
|
||||||
const mentionsBeginning = rawContent?.current?.[0]
|
const mentionsBeginning = rawContent?.current?.[0]?.length
|
||||||
|
? rawContent?.current?.[0]
|
||||||
.match(new RegExp(/^(?:@\S+\s+)+/))?.[0]
|
.match(new RegExp(/^(?:@\S+\s+)+/))?.[0]
|
||||||
?.match(new RegExp(/@\S+/, 'g'))
|
?.match(new RegExp(/@\S+/, 'g'))
|
||||||
|
: undefined
|
||||||
excludeMentions &&
|
excludeMentions &&
|
||||||
(excludeMentions.current =
|
(excludeMentions.current =
|
||||||
mentionsBeginning?.length && status?.mentions
|
mentionsBeginning?.length && status?.mentions
|
||||||
|
@ -92,7 +92,7 @@ const ScreenAccountSelection = ({
|
|||||||
const { colors } = useTheme()
|
const { colors } = useTheme()
|
||||||
const { t } = useTranslation('screenAccountSelection')
|
const { t } = useTranslation('screenAccountSelection')
|
||||||
|
|
||||||
const accounts = getReadableAccounts()
|
const accounts = getReadableAccounts(true)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
@ -17,7 +17,7 @@ const ComposeDrafts: React.FC<Props> = ({ accessibleRefDrafts }) => {
|
|||||||
const navigation = useNavigation<any>()
|
const navigation = useNavigation<any>()
|
||||||
const { composeState } = useContext(ComposeContext)
|
const { composeState } = useContext(ComposeContext)
|
||||||
const [drafts] = useAccountStorage.object('drafts')
|
const [drafts] = useAccountStorage.object('drafts')
|
||||||
const draftsCount = drafts.filter(draft => draft.timestamp !== composeState.timestamp).length
|
const draftsCount = drafts?.filter(draft => draft.timestamp !== composeState.timestamp).length
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
layoutAnimation()
|
layoutAnimation()
|
||||||
|
@ -60,7 +60,7 @@ const Collections: React.FC = () => {
|
|||||||
title={t('screenTabs:me.stacks.favourites.name')}
|
title={t('screenTabs:me.stacks.favourites.name')}
|
||||||
onPress={() => navigation.navigate('Tab-Me-Favourites')}
|
onPress={() => navigation.navigate('Tab-Me-Favourites')}
|
||||||
/>
|
/>
|
||||||
{pageMe.lists.shown ? (
|
{pageMe.lists?.shown ? (
|
||||||
<MenuRow
|
<MenuRow
|
||||||
iconFront='List'
|
iconFront='List'
|
||||||
iconBack='ChevronRight'
|
iconBack='ChevronRight'
|
||||||
@ -68,7 +68,7 @@ const Collections: React.FC = () => {
|
|||||||
onPress={() => navigation.navigate('Tab-Me-List-List')}
|
onPress={() => navigation.navigate('Tab-Me-List-List')}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{pageMe.followedTags.shown ? (
|
{pageMe.followedTags?.shown ? (
|
||||||
<MenuRow
|
<MenuRow
|
||||||
iconFront='Hash'
|
iconFront='Hash'
|
||||||
iconBack='ChevronRight'
|
iconBack='ChevronRight'
|
||||||
@ -76,7 +76,7 @@ const Collections: React.FC = () => {
|
|||||||
onPress={() => navigation.navigate('Tab-Me-FollowedTags')}
|
onPress={() => navigation.navigate('Tab-Me-FollowedTags')}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{pageMe.announcements.shown ? (
|
{pageMe.announcements?.shown ? (
|
||||||
<MenuRow
|
<MenuRow
|
||||||
iconFront='Clipboard'
|
iconFront='Clipboard'
|
||||||
iconBack='ChevronRight'
|
iconBack='ChevronRight'
|
||||||
|
@ -70,8 +70,8 @@ const TabNotificationsFilters: React.FC<
|
|||||||
<MenuRow
|
<MenuRow
|
||||||
key={index}
|
key={index}
|
||||||
title={t(`screenTabs:me.push.${type}.heading`)}
|
title={t(`screenTabs:me.push.${type}.heading`)}
|
||||||
switchValue={filters[type]}
|
switchValue={filters?.[type]}
|
||||||
switchOnValueChange={() => setFilters({ ...filters, [type]: !filters[type] })}
|
switchOnValueChange={() => setFilters({ ...filters, [type]: !filters?.[type] })}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</MenuContainer>
|
</MenuContainer>
|
||||||
@ -80,8 +80,8 @@ const TabNotificationsFilters: React.FC<
|
|||||||
<MenuRow
|
<MenuRow
|
||||||
key={type}
|
key={type}
|
||||||
title={t(`screenTabs:me.push.${type}.heading`)}
|
title={t(`screenTabs:me.push.${type}.heading`)}
|
||||||
switchValue={filters[type]}
|
switchValue={filters?.[type]}
|
||||||
switchOnValueChange={() => setFilters({ ...filters, [type]: !filters[type] })}
|
switchOnValueChange={() => setFilters({ ...filters, [type]: !filters?.[type] })}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</MenuContainer>
|
</MenuContainer>
|
||||||
|
@ -38,8 +38,11 @@ const Root: React.FC<NativeStackScreenProps<TabPublicStackParamList, 'Tab-Public
|
|||||||
const previousSegment = getGlobalStorage.string('app.prev_public_segment')
|
const previousSegment = getGlobalStorage.string('app.prev_public_segment')
|
||||||
const segments: StorageGlobal['app.prev_public_segment'][] = ['Local', 'LocalPublic', 'Trending']
|
const segments: StorageGlobal['app.prev_public_segment'][] = ['Local', 'LocalPublic', 'Trending']
|
||||||
const [segment, setSegment] = useState<number>(
|
const [segment, setSegment] = useState<number>(
|
||||||
|
Math.min(
|
||||||
|
0,
|
||||||
segments.findIndex(segment => segment === previousSegment)
|
segments.findIndex(segment => segment === previousSegment)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
const [routes] = useState([
|
const [routes] = useState([
|
||||||
{ key: 'Local', title: t('tabs.public.segments.local') },
|
{ key: 'Local', title: t('tabs.public.segments.local') },
|
||||||
{ key: 'LocalPublic', title: t('tabs.public.segments.federated') },
|
{ key: 'LocalPublic', title: t('tabs.public.segments.federated') },
|
||||||
|
@ -52,7 +52,7 @@ export const searchLocalStatus = async (uri: Mastodon.Status['uri']): Promise<Ma
|
|||||||
return await queryClient
|
return await queryClient
|
||||||
.fetchQuery(queryKey, queryFunction, { staleTime: 3600, cacheTime: 3600 })
|
.fetchQuery(queryKey, queryFunction, { staleTime: 3600, cacheTime: 3600 })
|
||||||
.then(res =>
|
.then(res =>
|
||||||
res.statuses[0].uri === uri || res.statuses[0].url === uri
|
res.statuses[0]?.uri === uri || res.statuses[0]?.url === uri
|
||||||
? res.statuses[0]
|
? res.statuses[0]
|
||||||
: Promise.reject()
|
: Promise.reject()
|
||||||
)
|
)
|
||||||
|
@ -233,14 +233,15 @@ export type ReadableAccountType = {
|
|||||||
key: string
|
key: string
|
||||||
active: boolean
|
active: boolean
|
||||||
}
|
}
|
||||||
export const getReadableAccounts = (): ReadableAccountType[] => {
|
export const getReadableAccounts = (withoutActive: boolean = false): ReadableAccountType[] => {
|
||||||
const accountActive = getGlobalStorage.string('account.active')
|
const accountActive = !withoutActive && getGlobalStorage.string('account.active')
|
||||||
const accounts = getGlobalStorage.object('accounts')?.sort((a, b) => a.localeCompare(b))
|
const accounts = getGlobalStorage.object('accounts')?.sort((a, b) => a.localeCompare(b))
|
||||||
|
!withoutActive &&
|
||||||
accounts?.splice(
|
accounts?.splice(
|
||||||
accounts.findIndex(a => a === accountActive),
|
accounts.findIndex(a => a === accountActive),
|
||||||
1
|
1
|
||||||
)
|
)
|
||||||
accounts?.unshift(accountActive || '')
|
!withoutActive && accounts?.unshift(accountActive || '')
|
||||||
return (
|
return (
|
||||||
accounts?.map(account => {
|
accounts?.map(account => {
|
||||||
const details = getAccountDetails(
|
const details = getAccountDetails(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user