mirror of
https://github.com/tooot-app/app
synced 2025-03-03 02:58:05 +01:00
commit
44374ce091
@ -4,7 +4,7 @@
|
|||||||
"native": "220214",
|
"native": "220214",
|
||||||
"major": 3,
|
"major": 3,
|
||||||
"minor": 5,
|
"minor": 5,
|
||||||
"patch": 2,
|
"patch": 3,
|
||||||
"expo": "44.0.0"
|
"expo": "44.0.0"
|
||||||
},
|
},
|
||||||
"description": "tooot app for Mastodon",
|
"description": "tooot app for Mastodon",
|
||||||
|
@ -37,7 +37,7 @@ const TimelineAvatar = React.memo(
|
|||||||
})
|
})
|
||||||
})}
|
})}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
uri={{ original: account.avatar, static: account.avatar_static }}
|
uri={{ original: account?.avatar, static: account?.avatar_static }}
|
||||||
dimension={{
|
dimension={{
|
||||||
width: StyleConstants.Avatar.M,
|
width: StyleConstants.Avatar.M,
|
||||||
height: StyleConstants.Avatar.M
|
height: StyleConstants.Avatar.M
|
||||||
|
@ -11,7 +11,6 @@ import accountInitialState from '@screens/Tabs/Shared/Account/utils/initialState
|
|||||||
import accountReducer from '@screens/Tabs/Shared/Account/utils/reducer'
|
import accountReducer from '@screens/Tabs/Shared/Account/utils/reducer'
|
||||||
import { useProfileQuery } from '@utils/queryHooks/profile'
|
import { useProfileQuery } from '@utils/queryHooks/profile'
|
||||||
import { getInstanceActive } from '@utils/slices/instancesSlice'
|
import { getInstanceActive } from '@utils/slices/instancesSlice'
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
|
||||||
import React, { useReducer, useRef } from 'react'
|
import React, { useReducer, useRef } from 'react'
|
||||||
import Animated, {
|
import Animated, {
|
||||||
useAnimatedScrollHandler,
|
useAnimatedScrollHandler,
|
||||||
@ -50,7 +49,6 @@ const TabMeRoot: React.FC = () => {
|
|||||||
keyboardShouldPersistTaps='handled'
|
keyboardShouldPersistTaps='handled'
|
||||||
onScroll={onScroll}
|
onScroll={onScroll}
|
||||||
scrollEventThrottle={16}
|
scrollEventThrottle={16}
|
||||||
style={{ marginBottom: StyleConstants.Spacing.L }}
|
|
||||||
>
|
>
|
||||||
{instanceActive !== -1 ? (
|
{instanceActive !== -1 ? (
|
||||||
<MyInfo account={data} />
|
<MyInfo account={data} />
|
||||||
|
@ -21,7 +21,8 @@ const Logout: React.FC = () => {
|
|||||||
content={t('me.root.logout.button')}
|
content={t('me.root.logout.button')}
|
||||||
style={{
|
style={{
|
||||||
marginHorizontal: StyleConstants.Spacing.Global.PagePadding * 2,
|
marginHorizontal: StyleConstants.Spacing.Global.PagePadding * 2,
|
||||||
marginTop: StyleConstants.Spacing.Global.PagePadding
|
marginTop: StyleConstants.Spacing.Global.PagePadding,
|
||||||
|
marginBottom: StyleConstants.Spacing.Global.PagePadding * 2
|
||||||
}}
|
}}
|
||||||
destructive
|
destructive
|
||||||
onPress={() =>
|
onPress={() =>
|
||||||
|
@ -6,7 +6,6 @@ import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
|||||||
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import { FlatList } from 'react-native'
|
import { FlatList } from 'react-native'
|
||||||
import { InfiniteQueryObserver, useQueryClient } from 'react-query'
|
import { InfiniteQueryObserver, useQueryClient } from 'react-query'
|
||||||
import * as Sentry from 'sentry-expo'
|
|
||||||
|
|
||||||
const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
||||||
route: {
|
route: {
|
||||||
@ -45,25 +44,15 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
|||||||
scrolled.current = true
|
scrolled.current = true
|
||||||
const pointer = flattenData.findIndex(({ id }) => id === toot.id)
|
const pointer = flattenData.findIndex(({ id }) => id === toot.id)
|
||||||
if (pointer < 1) return
|
if (pointer < 1) return
|
||||||
Sentry.Native.setContext('Scroll to Index', {
|
|
||||||
type: 'original',
|
|
||||||
index: pointer,
|
|
||||||
itemsLength: flattenData.length,
|
|
||||||
id: toot.id,
|
|
||||||
flattenData: flattenData.map(({ id }) => id)
|
|
||||||
})
|
|
||||||
try {
|
try {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
console.log('scrolling')
|
||||||
flRef.current?.scrollToIndex({
|
flRef.current?.scrollToIndex({
|
||||||
index: pointer,
|
index: pointer,
|
||||||
viewOffset: 100
|
viewOffset: 100
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 500)
|
||||||
} catch (err) {
|
} catch {}
|
||||||
if (Math.random() < 0.05) {
|
|
||||||
Sentry.Native.captureException(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -74,12 +63,6 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
|||||||
error => {
|
error => {
|
||||||
const offset = error.averageItemLength * error.index
|
const offset = error.averageItemLength * error.index
|
||||||
flRef.current?.scrollToOffset({ offset })
|
flRef.current?.scrollToOffset({ offset })
|
||||||
Sentry.Native.setContext('Scroll to Index', {
|
|
||||||
type: 'onScrollToIndexFailed',
|
|
||||||
index: error.index,
|
|
||||||
itemsLength,
|
|
||||||
id: toot.id
|
|
||||||
})
|
|
||||||
try {
|
try {
|
||||||
error.index < itemsLength &&
|
error.index < itemsLength &&
|
||||||
setTimeout(
|
setTimeout(
|
||||||
@ -90,11 +73,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
|||||||
}),
|
}),
|
||||||
500
|
500
|
||||||
)
|
)
|
||||||
} catch (err) {
|
} catch {}
|
||||||
if (Math.random() < 0.05) {
|
|
||||||
Sentry.Native.captureException(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
[itemsLength]
|
[itemsLength]
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user