Fix push token not updated

This commit is contained in:
xmflsct 2023-02-28 20:43:37 +01:00
parent 4ce3ce58ab
commit 0450019cac
3 changed files with 13 additions and 17 deletions

View File

@ -1,6 +1,6 @@
{
"name": "tooot",
"version": "4.9.0",
"version": "4.9.1",
"description": "tooot for Mastodon",
"author": "xmflsct <me@xmflsct.com>",
"license": "GPL-3.0-or-later",

View File

@ -265,7 +265,7 @@ const Timeline: React.FC<Props> = ({
initialNumToRender={3}
maxToRenderPerBatch={2}
onEndReached={() => !disableInfinity && !isFetchingNextPage && fetchNextPage()}
onEndReachedThreshold={0.75}
onEndReachedThreshold={0.8}
ListFooterComponent={
<TimelineFooter queryKey={queryKey} disableInfinity={disableInfinity} />
}

View File

@ -11,20 +11,16 @@ export const updateExpoToken = async (): Promise<string> => {
await setChannels()
}
if (expoToken?.length) {
return Promise.resolve(expoToken)
} else {
if (isDevelopment) {
setGlobalStorage('app.expo_token', 'ExponentPushToken[DEVELOPMENT_1]')
return Promise.resolve('ExponentPushToken[DEVELOPMENT_1]')
}
return await Notifications.getExpoPushTokenAsync({
experienceId: '@xmflsct/tooot',
applicationId: 'com.xmflsct.app.tooot'
}).then(({ data }) => {
setGlobalStorage('app.expo_token', data)
return data
})
if (isDevelopment) {
setGlobalStorage('app.expo_token', 'ExponentPushToken[DEVELOPMENT_1]')
return 'ExponentPushToken[DEVELOPMENT_1]'
}
return await Notifications.getExpoPushTokenAsync({
experienceId: '@xmflsct/tooot',
applicationId: 'com.xmflsct.app.tooot'
}).then(({ data }) => {
setGlobalStorage('app.expo_token', data)
return data
})
}