Fixed notifications vanishing when app wasn't ready and sometimes showing up twice

This commit is contained in:
florian committed 2026-10-27 17:16:29 +01:00
1 parent ed7c6d630c
commit 78769604a5
6 files changed
+2651 -6775

No files matched your search

+3 -3
View File
@@ -1,8 +1,8 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import { createDrawerNavigator, DrawerContentScrollView, DrawerItemList } from '@react-navigation/drawer';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { Button, Linking, ScrollView, Text, TextInput, TouchableOpacity, View } from 'react-native';
import { STORAGE_KEY, useNotificationListener } from '../hooks/useNotificationListener';
import { clearStoredNotifications, useNotificationListener } from '../hooks/useNotificationListener';
import { usePushNotifications } from '../hooks/usePushNotifications';
import { version as appVersion } from '../package.json';
import { styles } from '../styles/styles';
@@ -156,7 +156,7 @@ export default function App() {
const handleLogout = async () => {
if (unregisterToken) await unregisterToken();
await AsyncStorage.removeItem(API_KEY_STORAGE);
await AsyncStorage.removeItem(STORAGE_KEY);
await clearStoredNotifications();
setApiKey(null);
setApiKeySaved(false);
setNotifications([]);