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:
@ -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()
|
||||
|
Reference in New Issue
Block a user