fix: don't run migration for new users

This commit is contained in:
ammarahm-ed
2022-03-03 22:31:23 +05:00
parent 35f9cef9f8
commit 371520c9c9
6 changed files with 30 additions and 16 deletions

View File

@@ -136,8 +136,9 @@ export const useAppEvents = () => {
};
useEffect(() => {
let sub;
if (!loading) {
AppState.addEventListener('change', onAppStateChanged);
sub = AppState.addEventListener('change', onAppStateChanged);
(async () => {
try {
let url = await Linking.getInitialURL();
@@ -153,7 +154,7 @@ export const useAppEvents = () => {
return () => {
refValues.current?.removeInternetStateListener &&
refValues.current?.removeInternetStateListener();
AppState.removeEventListener('change', onAppStateChanged);
sub?.remove();
unsubIAP();
};
}, [loading]);