register update
This commit is contained in:
@@ -44,9 +44,7 @@ const RegisterConfirmScreen = () => {
|
||||
const storedPhone = await AsyncStorage.getItem('phone');
|
||||
if (storedPhone) setPhone(storedPhone);
|
||||
else setPhone(null);
|
||||
} catch (error) {
|
||||
console.log('AsyncStorage error:', error);
|
||||
}
|
||||
} catch (error) { }
|
||||
};
|
||||
loadPhone();
|
||||
}, []);
|
||||
@@ -67,6 +65,7 @@ const RegisterConfirmScreen = () => {
|
||||
savedToken(res.data.data.token.access);
|
||||
await AsyncStorage.setItem('refresh_token', res.data.data.token.refresh);
|
||||
await login(res.data.data.token.access);
|
||||
|
||||
const pushToken = await registerForPushNotificationsAsync();
|
||||
if (pushToken) {
|
||||
await commonRequests.registerDevice({
|
||||
@@ -78,6 +77,8 @@ const RegisterConfirmScreen = () => {
|
||||
// Notification querylarni refetch
|
||||
queryClient.refetchQueries({ queryKey: ['notification-list'] });
|
||||
queryClient.refetchQueries({ queryKey: ['notifications-list'] });
|
||||
|
||||
// Dashboardga yo‘naltirish
|
||||
router.replace('/(dashboard)');
|
||||
},
|
||||
onError: (err: any) => {
|
||||
|
||||
Reference in New Issue
Block a user