mirror of
				https://github.com/tooot-app/app
				synced 2025-06-05 22:19:13 +02:00 
			
		
		
		
	Allow push count badge
This commit is contained in:
		@@ -18,7 +18,7 @@ import {
 | 
			
		||||
import {
 | 
			
		||||
  getVersionUpdate,
 | 
			
		||||
  retriveVersionLatest
 | 
			
		||||
} from '@utils/slices/versionSlice'
 | 
			
		||||
} from '@utils/slices/appSlice'
 | 
			
		||||
import { useTheme } from '@utils/styles/ThemeManager'
 | 
			
		||||
import React, { useCallback, useEffect, useMemo } from 'react'
 | 
			
		||||
import { Platform } from 'react-native'
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,7 @@ import { MenuContainer, MenuRow } from '@components/Menu'
 | 
			
		||||
import CustomText from '@components/Text'
 | 
			
		||||
import { useAppDispatch } from '@root/store'
 | 
			
		||||
import { isDevelopment } from '@utils/checkEnvironment'
 | 
			
		||||
import { getExpoToken } from '@utils/slices/appSlice'
 | 
			
		||||
import { updateInstancePush } from '@utils/slices/instances/updatePush'
 | 
			
		||||
import { updateInstancePushAlert } from '@utils/slices/instances/updatePushAlert'
 | 
			
		||||
import { updateInstancePushDecode } from '@utils/slices/instances/updatePushDecode'
 | 
			
		||||
@@ -45,16 +46,12 @@ const TabMePush: React.FC = () => {
 | 
			
		||||
    setPushEnabled(settings.granted)
 | 
			
		||||
    setPushCanAskAgain(settings.canAskAgain)
 | 
			
		||||
  }
 | 
			
		||||
  const expoToken = useSelector(getExpoToken)
 | 
			
		||||
  useEffect(() => {
 | 
			
		||||
    if (isDevelopment) {
 | 
			
		||||
      setPushAvailable(true)
 | 
			
		||||
    } else {
 | 
			
		||||
      Notifications.getExpoPushTokenAsync({
 | 
			
		||||
        experienceId: '@xmflsct/tooot',
 | 
			
		||||
        applicationId: 'com.xmflsct.app.tooot'
 | 
			
		||||
      })
 | 
			
		||||
        .then(data => setPushAvailable(!!data))
 | 
			
		||||
        .catch(() => setPushAvailable(false))
 | 
			
		||||
      setPushAvailable(!!expoToken)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    checkPush()
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
import { MenuContainer, MenuRow } from '@components/Menu'
 | 
			
		||||
import { getVersionUpdate } from '@utils/slices/versionSlice'
 | 
			
		||||
import { getVersionUpdate } from '@utils/slices/appSlice'
 | 
			
		||||
import React from 'react'
 | 
			
		||||
import { useTranslation } from 'react-i18next'
 | 
			
		||||
import { Linking, Platform } from 'react-native'
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user