2020-11-16 12:36:41 +05:00
|
|
|
import * as NetInfo from '@react-native-community/netinfo';
|
2021-01-05 11:05:52 +05:00
|
|
|
import {EV} from 'notes-core/common';
|
|
|
|
|
import React, {useEffect} from 'react';
|
2020-11-24 16:59:12 +05:00
|
|
|
import {
|
|
|
|
|
Appearance,
|
|
|
|
|
AppState,
|
|
|
|
|
Linking,
|
|
|
|
|
NativeModules,
|
|
|
|
|
Platform,
|
2021-01-05 11:05:52 +05:00
|
|
|
StatusBar,
|
2020-11-24 16:59:12 +05:00
|
|
|
} from 'react-native';
|
2020-12-09 22:16:22 +05:00
|
|
|
import * as RNIap from 'react-native-iap';
|
2021-01-05 11:05:52 +05:00
|
|
|
import {enabled} from 'react-native-privacy-snapshot';
|
|
|
|
|
import {SafeAreaProvider} from 'react-native-safe-area-context';
|
2020-12-10 09:54:48 +05:00
|
|
|
import SplashScreen from 'react-native-splash-screen';
|
2021-01-05 11:05:52 +05:00
|
|
|
import {RootView} from './initializer.root';
|
2021-01-08 12:30:05 +05:00
|
|
|
import {updateEvent} from './src/components/DialogManager/recievers';
|
2021-01-05 11:05:52 +05:00
|
|
|
import {useTracked} from './src/provider';
|
|
|
|
|
import {Actions} from './src/provider/Actions';
|
2020-12-20 23:01:35 +05:00
|
|
|
import Backup from './src/services/Backup';
|
2021-01-05 11:05:52 +05:00
|
|
|
import {DDS} from './src/services/DeviceDetection';
|
2020-10-24 13:47:31 +05:00
|
|
|
import {
|
2020-11-24 16:59:12 +05:00
|
|
|
eSendEvent,
|
2020-10-24 13:47:31 +05:00
|
|
|
eSubscribeEvent,
|
2021-01-05 11:05:52 +05:00
|
|
|
eUnSubscribeEvent,
|
2020-10-24 13:47:31 +05:00
|
|
|
} from './src/services/EventManager';
|
2020-12-16 14:57:58 +05:00
|
|
|
import {
|
|
|
|
|
clearMessage,
|
|
|
|
|
setEmailVerifyMessage,
|
2021-01-05 11:05:52 +05:00
|
|
|
setLoginMessage,
|
2020-12-16 14:57:58 +05:00
|
|
|
} from './src/services/Message';
|
2020-12-10 09:54:48 +05:00
|
|
|
import PremiumService from './src/services/PremiumService';
|
2020-12-20 23:03:02 +05:00
|
|
|
import SettingsService from './src/services/SettingsService';
|
2020-12-20 23:01:35 +05:00
|
|
|
import Sync from './src/services/Sync';
|
2021-01-05 11:05:52 +05:00
|
|
|
import {
|
2021-01-05 15:18:30 +05:00
|
|
|
APP_VERSION,
|
2021-01-05 11:05:52 +05:00
|
|
|
editing,
|
|
|
|
|
getAppIsIntialized,
|
|
|
|
|
setAppIsInitialized,
|
|
|
|
|
setIntentOnAppLoadProcessed,
|
|
|
|
|
} from './src/utils';
|
|
|
|
|
import {COLOR_SCHEME} from './src/utils/Colors';
|
|
|
|
|
import {db} from './src/utils/DB';
|
2020-12-06 09:53:17 +05:00
|
|
|
import {
|
2020-12-09 22:16:22 +05:00
|
|
|
eClosePremiumDialog,
|
2020-12-23 13:25:10 +05:00
|
|
|
eCloseProgressDialog,
|
2020-12-06 09:53:17 +05:00
|
|
|
eDispatchAction,
|
2020-12-16 20:02:24 +05:00
|
|
|
eOpenLoginDialog,
|
2020-12-09 22:16:22 +05:00
|
|
|
eOpenPendingDialog,
|
2020-12-16 20:02:24 +05:00
|
|
|
eOpenProgressDialog,
|
2020-12-14 14:03:35 +05:00
|
|
|
eOpenSideMenu,
|
2021-01-05 11:05:52 +05:00
|
|
|
refreshNotesPage,
|
2020-12-06 09:53:17 +05:00
|
|
|
} from './src/utils/Events';
|
2021-01-05 11:05:52 +05:00
|
|
|
import {MMKV} from './src/utils/mmkv';
|
|
|
|
|
import {sleep} from './src/utils/TimeUtils';
|
2021-01-08 12:30:05 +05:00
|
|
|
import EditorRoot from './src/views/Editor/EditorRoot';
|
|
|
|
|
import {getNote} from './src/views/Editor/Functions';
|
2021-01-09 11:15:21 +05:00
|
|
|
import Sentry from '@sentry/react-native';
|
2020-12-09 22:16:22 +05:00
|
|
|
let hasPurchased = false;
|
2020-12-20 23:01:35 +05:00
|
|
|
|
|
|
|
|
function updateStatusBarColor() {
|
|
|
|
|
StatusBar.setBarStyle(
|
|
|
|
|
COLOR_SCHEME.night ? 'light-content' : 'dark-content',
|
|
|
|
|
true,
|
|
|
|
|
);
|
|
|
|
|
if (Platform.OS === 'android') {
|
|
|
|
|
StatusBar.setBackgroundColor('transparent', true);
|
|
|
|
|
StatusBar.setTranslucent(true, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-18 18:18:27 +05:00
|
|
|
const onAppStateChanged = async (state) => {
|
|
|
|
|
if (state === 'active') {
|
2020-12-20 23:01:35 +05:00
|
|
|
updateStatusBarColor();
|
2020-11-18 18:18:27 +05:00
|
|
|
if (SettingsService.get().privacyScreen) {
|
|
|
|
|
enabled(false);
|
2021-01-05 11:05:52 +05:00
|
|
|
}
|
2020-12-29 17:18:20 +05:00
|
|
|
if (getAppIsIntialized()) {
|
2020-11-23 15:57:31 +05:00
|
|
|
await MMKV.removeItem('appState');
|
2021-01-08 12:30:05 +05:00
|
|
|
let intent = await MMKV.getItem('notesAddedFromIntent');
|
|
|
|
|
if (intent) {
|
|
|
|
|
try {
|
|
|
|
|
if (Platform.OS === 'ios') {
|
|
|
|
|
await db.init();
|
|
|
|
|
await db.notes.init();
|
|
|
|
|
updateEvent({type: Actions.NOTES});
|
|
|
|
|
eSendEvent(refreshNotesPage);
|
|
|
|
|
} else {
|
|
|
|
|
updateEvent({type: Actions.NOTES});
|
|
|
|
|
eSendEvent(refreshNotesPage);
|
2020-12-06 09:53:17 +05:00
|
|
|
}
|
2021-01-08 12:30:05 +05:00
|
|
|
} catch (e) {
|
|
|
|
|
console.log(e);
|
2020-12-29 11:26:01 +05:00
|
|
|
}
|
2021-01-08 12:30:05 +05:00
|
|
|
MMKV.removeItem('notesAddedFromIntent');
|
|
|
|
|
updateEvent({type: Actions.ALL});
|
|
|
|
|
eSendEvent(refreshNotesPage);
|
2020-11-24 16:59:12 +05:00
|
|
|
}
|
2021-01-08 12:30:05 +05:00
|
|
|
}
|
2020-11-18 18:18:27 +05:00
|
|
|
} else {
|
2020-12-30 15:20:16 +05:00
|
|
|
if (editing.currentlyEditing && getAppIsIntialized()) {
|
2020-11-23 15:57:31 +05:00
|
|
|
let state = JSON.stringify({
|
|
|
|
|
editing: editing.currentlyEditing,
|
|
|
|
|
note: getNote(),
|
|
|
|
|
});
|
|
|
|
|
await MMKV.setItem('appState', state);
|
2020-11-23 11:30:55 +05:00
|
|
|
}
|
|
|
|
|
|
2020-11-18 18:18:27 +05:00
|
|
|
if (SettingsService.get().privacyScreen) {
|
|
|
|
|
enabled(true);
|
|
|
|
|
}
|
2020-11-16 12:18:59 +05:00
|
|
|
}
|
2020-11-16 12:13:02 +05:00
|
|
|
};
|
|
|
|
|
|
2021-01-08 12:30:05 +05:00
|
|
|
//const onNetworkStateChanged = (netInfo) => {};
|
2020-11-16 12:36:41 +05:00
|
|
|
|
2019-11-15 01:17:59 +05:00
|
|
|
const App = () => {
|
2020-12-22 12:38:31 +05:00
|
|
|
const [, dispatch] = useTracked();
|
2020-11-16 12:36:41 +05:00
|
|
|
|
2020-12-20 23:01:35 +05:00
|
|
|
let subsriptionSuccessListerner;
|
|
|
|
|
let subsriptionErrorListener;
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
eSubscribeEvent(eDispatchAction, (type) => {
|
|
|
|
|
dispatch(type);
|
|
|
|
|
});
|
|
|
|
|
attachIAPListeners();
|
|
|
|
|
AppState.addEventListener('change', onAppStateChanged);
|
|
|
|
|
Appearance.addChangeListener(SettingsService.setTheme);
|
|
|
|
|
Linking.addEventListener('url', onUrlRecieved);
|
|
|
|
|
EV.subscribe('db:refresh', onSyncComplete);
|
|
|
|
|
EV.subscribe('db:sync', partialSync);
|
|
|
|
|
EV.subscribe('user:loggedOut', onLogout);
|
2021-01-08 19:42:34 +05:00
|
|
|
EV.subscribe('user:emailConfirmed', onEmailVerified);
|
2020-12-20 23:01:35 +05:00
|
|
|
EV.subscribe('user:checkStatus', PremiumService.onUserStatusCheck);
|
|
|
|
|
return () => {
|
2021-01-06 16:21:50 +05:00
|
|
|
setIntentOnAppLoadProcessed(false);
|
|
|
|
|
setAppIsInitialized(false);
|
2021-01-08 19:42:34 +05:00
|
|
|
EV.unsubscribe('user:emailConfirmed', onEmailVerified);
|
|
|
|
|
EV.unsubscribe('db:refresh', onSyncComplete);
|
2020-12-20 23:01:35 +05:00
|
|
|
EV.unsubscribe('user:loggedOut', onLogout);
|
|
|
|
|
EV.unsubscribe('db:sync', partialSync);
|
|
|
|
|
EV.unsubscribe('user:checkStatus', PremiumService.onUserStatusCheck);
|
|
|
|
|
eUnSubscribeEvent(eDispatchAction, (type) => {
|
|
|
|
|
dispatch(type);
|
|
|
|
|
});
|
|
|
|
|
AppState.removeEventListener('change', onAppStateChanged);
|
|
|
|
|
Appearance.removeChangeListener(SettingsService.setTheme);
|
|
|
|
|
Linking.removeEventListener('url', onUrlRecieved);
|
2021-01-08 12:30:05 +05:00
|
|
|
//unsub();
|
2020-12-20 23:01:35 +05:00
|
|
|
unsubIAP();
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
2020-12-29 11:26:01 +05:00
|
|
|
SettingsService.init().then((r) => console.log);
|
2020-12-20 23:01:35 +05:00
|
|
|
dispatch({
|
|
|
|
|
type: Actions.DEVICE_MODE,
|
|
|
|
|
state: DDS.isLargeTablet()
|
|
|
|
|
? 'tablet'
|
|
|
|
|
: DDS.isSmallTab
|
|
|
|
|
? 'smallTablet'
|
|
|
|
|
: 'mobile',
|
|
|
|
|
});
|
2021-01-08 12:30:05 +05:00
|
|
|
db.init().catch(console.log).finally(loadMainApp);
|
2020-12-20 23:01:35 +05:00
|
|
|
}, []);
|
2020-10-12 11:24:56 +05:00
|
|
|
|
2020-12-20 23:01:35 +05:00
|
|
|
const onSyncComplete = async () => {
|
|
|
|
|
dispatch({type: Actions.ALL});
|
2020-12-28 14:22:23 +05:00
|
|
|
dispatch({type: Actions.LAST_SYNC, lastSync: await db.lastSynced()});
|
2020-11-16 12:36:41 +05:00
|
|
|
};
|
|
|
|
|
|
2020-12-20 23:01:35 +05:00
|
|
|
const onUrlRecieved = async (res) => {
|
2021-01-08 12:30:05 +05:00
|
|
|
let url = res ? res.url : '';
|
|
|
|
|
try {
|
|
|
|
|
if (url.startsWith('https://app.notesnook.com/account/verified')) {
|
|
|
|
|
await onEmailVerified();
|
|
|
|
|
} else {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {}
|
2020-12-06 09:53:17 +05:00
|
|
|
};
|
|
|
|
|
|
2020-12-23 13:25:10 +05:00
|
|
|
const onEmailVerified = async () => {
|
2021-01-08 19:42:34 +05:00
|
|
|
let user = await db.user.getUser();
|
2020-12-23 13:25:10 +05:00
|
|
|
dispatch({type: Actions.USER, user: user});
|
2020-12-29 11:57:04 +05:00
|
|
|
if (!user) return;
|
2021-01-08 12:30:05 +05:00
|
|
|
await PremiumService.setPremiumStatus();
|
2020-12-23 13:25:10 +05:00
|
|
|
let message =
|
|
|
|
|
user?.subscription?.type === 2
|
|
|
|
|
? 'Thank you for signing up for Notesnook Beta Program. Enjoy all premium features for free for the next 3 months.'
|
|
|
|
|
: 'Your Notesnook Pro Trial has been activated. Enjoy all premium features for free for the next 14 days!';
|
|
|
|
|
eSendEvent(eOpenProgressDialog, {
|
|
|
|
|
title: 'Email Confirmed!',
|
|
|
|
|
paragraph: message,
|
|
|
|
|
noProgress: true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (user?.isEmailConfirmed) {
|
|
|
|
|
clearMessage(dispatch);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2020-12-09 22:16:22 +05:00
|
|
|
const attachIAPListeners = () => {
|
|
|
|
|
if (Platform.OS === 'ios') {
|
|
|
|
|
RNIap.getReceiptIOS()
|
|
|
|
|
.then((r) => {
|
|
|
|
|
hasPurchased = true;
|
|
|
|
|
processReceipt(r);
|
|
|
|
|
})
|
|
|
|
|
.catch(console.log)
|
|
|
|
|
.finally(() => {
|
|
|
|
|
subsriptionSuccessListerner = RNIap.purchaseUpdatedListener(
|
|
|
|
|
onSuccessfulSubscription,
|
|
|
|
|
);
|
|
|
|
|
subsriptionErrorListener = RNIap.purchaseErrorListener(
|
|
|
|
|
onSubscriptionError,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
subsriptionSuccessListerner = RNIap.purchaseUpdatedListener(
|
|
|
|
|
onSuccessfulSubscription,
|
|
|
|
|
);
|
|
|
|
|
subsriptionErrorListener = RNIap.purchaseErrorListener(
|
|
|
|
|
onSubscriptionError,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2020-12-20 23:01:35 +05:00
|
|
|
const partialSync = async () => {
|
2020-12-10 15:26:02 +05:00
|
|
|
try {
|
|
|
|
|
dispatch({type: Actions.SYNCING, syncing: true});
|
|
|
|
|
await db.sync(false);
|
2020-12-16 14:57:58 +05:00
|
|
|
dispatch({type: Actions.LAST_SYNC, lastSync: await db.lastSynced()});
|
2020-12-10 15:26:02 +05:00
|
|
|
} catch (e) {
|
|
|
|
|
} finally {
|
|
|
|
|
dispatch({type: Actions.SYNCING, syncing: false});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-08 12:30:05 +05:00
|
|
|
const onLogout = async (reason) => {
|
2021-01-05 11:05:52 +05:00
|
|
|
dispatch({type: Actions.USER, user: null});
|
|
|
|
|
dispatch({type: Actions.CLEAR_ALL});
|
|
|
|
|
dispatch({type: Actions.SYNCING, syncing: false});
|
|
|
|
|
setLoginMessage(dispatch);
|
2021-01-08 12:30:05 +05:00
|
|
|
await PremiumService.setPremiumStatus();
|
2020-12-16 20:02:24 +05:00
|
|
|
eSendEvent(eOpenProgressDialog, {
|
2021-01-05 11:05:52 +05:00
|
|
|
title: reason ? reason : 'User Logged Out',
|
|
|
|
|
paragraph: `You have been logged out of your account.`,
|
2020-12-28 14:22:23 +05:00
|
|
|
action: async () => {
|
|
|
|
|
eSendEvent(eCloseProgressDialog);
|
2020-12-29 11:26:01 +05:00
|
|
|
await sleep(50);
|
2020-12-16 20:02:24 +05:00
|
|
|
eSendEvent(eOpenLoginDialog);
|
|
|
|
|
},
|
2020-12-23 13:25:10 +05:00
|
|
|
icon: 'logout',
|
2020-12-16 20:02:24 +05:00
|
|
|
actionText: 'Login Again',
|
|
|
|
|
noProgress: true,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2020-12-09 22:16:22 +05:00
|
|
|
unsubIAP = () => {
|
|
|
|
|
if (subsriptionSuccessListerner) {
|
|
|
|
|
subsriptionSuccessListerner?.remove();
|
|
|
|
|
subsriptionSuccessListerner = null;
|
|
|
|
|
}
|
|
|
|
|
if (subsriptionErrorListener) {
|
|
|
|
|
subsriptionErrorListener?.remove();
|
|
|
|
|
subsriptionErrorListener = null;
|
|
|
|
|
}
|
|
|
|
|
};
|
2020-12-09 13:09:55 +05:00
|
|
|
|
2020-12-09 22:16:22 +05:00
|
|
|
const loadMainApp = () => {
|
2020-11-24 16:59:12 +05:00
|
|
|
dispatch({type: Actions.ALL});
|
2020-12-20 23:01:35 +05:00
|
|
|
setCurrentUser().then(console.log).catch(console.log);
|
|
|
|
|
Backup.checkAndRun().then((r) => r);
|
2021-01-08 12:30:05 +05:00
|
|
|
sleep(500).then(() => {
|
|
|
|
|
setAppIsInitialized(true);
|
|
|
|
|
SplashScreen.hide();
|
|
|
|
|
});
|
2020-11-24 16:59:12 +05:00
|
|
|
db.notes.init().then(() => {
|
|
|
|
|
dispatch({type: Actions.NOTES});
|
2020-12-16 15:55:36 +05:00
|
|
|
dispatch({type: Actions.FAVORITES});
|
2020-12-16 20:02:24 +05:00
|
|
|
eSendEvent(refreshNotesPage);
|
2020-11-24 16:59:12 +05:00
|
|
|
dispatch({type: Actions.LOADING, loading: false});
|
2020-11-26 11:20:38 +05:00
|
|
|
SettingsService.setAppLoaded();
|
2020-11-24 16:59:12 +05:00
|
|
|
});
|
2020-12-23 13:25:10 +05:00
|
|
|
Linking.getInitialURL().then(async (url) => {
|
2021-01-08 12:30:05 +05:00
|
|
|
if (url && url.startsWith('https://app.notesnook.com/account/verified')) {
|
2020-12-23 13:25:10 +05:00
|
|
|
await onEmailVerified();
|
|
|
|
|
}
|
|
|
|
|
});
|
2021-01-05 15:18:30 +05:00
|
|
|
sleep(300).then(() => {
|
|
|
|
|
eSendEvent(eOpenSideMenu);
|
|
|
|
|
db.version()
|
|
|
|
|
.then((ver) => {
|
2021-01-05 15:20:04 +05:00
|
|
|
if (ver.mobile > APP_VERSION) {
|
2021-01-05 15:18:30 +05:00
|
|
|
eSendEvent('updateDialog', ver);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(console.log);
|
|
|
|
|
});
|
|
|
|
|
|
2021-01-09 11:15:21 +05:00
|
|
|
Sentry.init({
|
|
|
|
|
dsn:
|
|
|
|
|
'https://317a5c31caf64d1e9b27abf15eb1a554@o477952.ingest.sentry.io/5519681',
|
|
|
|
|
});
|
|
|
|
|
|
2020-11-23 11:30:55 +05:00
|
|
|
};
|
|
|
|
|
|
2020-12-20 23:01:35 +05:00
|
|
|
const setCurrentUser = async () => {
|
2020-11-23 11:30:55 +05:00
|
|
|
try {
|
2021-01-08 12:30:05 +05:00
|
|
|
let user = await db.user.fetchUser(true);
|
2020-11-23 11:30:55 +05:00
|
|
|
if (user) {
|
2020-12-16 14:57:58 +05:00
|
|
|
clearMessage(dispatch);
|
2021-01-08 19:42:34 +05:00
|
|
|
dispatch({type: Actions.USER, user: user});
|
|
|
|
|
await PremiumService.setPremiumStatus();
|
2020-12-16 14:57:58 +05:00
|
|
|
if (!user.isEmailConfirmed) {
|
|
|
|
|
setEmailVerifyMessage(dispatch);
|
2021-01-08 19:42:34 +05:00
|
|
|
return;
|
2020-12-16 14:57:58 +05:00
|
|
|
}
|
2020-12-20 23:01:35 +05:00
|
|
|
await Sync.run();
|
2020-11-23 11:30:55 +05:00
|
|
|
} else {
|
2021-01-08 12:30:05 +05:00
|
|
|
await PremiumService.setPremiumStatus();
|
2020-11-23 11:30:55 +05:00
|
|
|
setLoginMessage(dispatch);
|
|
|
|
|
}
|
2021-01-08 19:42:34 +05:00
|
|
|
} catch (e) {
|
|
|
|
|
let user = await db.user.getUser();
|
|
|
|
|
if (user && !user.isEmailConfirmed) {
|
|
|
|
|
setEmailVerifyMessage(dispatch);
|
|
|
|
|
} else if (!user) {
|
|
|
|
|
setLoginMessage(dispatch);
|
|
|
|
|
} else {
|
|
|
|
|
console.log('unknown error', e);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-15 12:16:22 +05:00
|
|
|
};
|
|
|
|
|
|
2020-12-09 22:16:22 +05:00
|
|
|
const onSuccessfulSubscription = (subscription) => {
|
|
|
|
|
if (hasPurchased) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const receipt = subscription.transactionReceipt;
|
|
|
|
|
processReceipt(receipt);
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
eSendEvent(eClosePremiumDialog);
|
|
|
|
|
eSendEvent(eOpenPendingDialog);
|
|
|
|
|
}, 500);
|
|
|
|
|
};
|
|
|
|
|
|
2020-12-20 23:01:35 +05:00
|
|
|
const onSubscriptionError = (error) => {};
|
2020-12-09 22:16:22 +05:00
|
|
|
|
2020-12-10 13:06:59 +05:00
|
|
|
const processReceipt = (receipt) => {
|
2020-12-10 15:26:02 +05:00
|
|
|
return;
|
2020-12-10 13:06:59 +05:00
|
|
|
if (receipt) {
|
|
|
|
|
if (Platform.OS === 'ios') {
|
|
|
|
|
fetch('http://192.168.10.5:8100/webhooks/assn', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
body: JSON.stringify({
|
2020-12-10 15:26:02 +05:00
|
|
|
receipt_data: receipt,
|
2020-12-10 13:06:59 +05:00
|
|
|
}),
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
|
},
|
2020-12-09 22:16:22 +05:00
|
|
|
})
|
2020-12-10 13:06:59 +05:00
|
|
|
.then((r) => {
|
|
|
|
|
console.log(r.status, 'STATUS');
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
console.log(e, 'ERROR');
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-12-09 22:16:22 +05:00
|
|
|
}
|
2020-12-10 13:06:59 +05:00
|
|
|
};
|
2020-12-09 22:16:22 +05:00
|
|
|
|
2020-10-24 13:47:31 +05:00
|
|
|
return (
|
2020-11-23 11:30:55 +05:00
|
|
|
<SafeAreaProvider>
|
2020-12-22 12:38:31 +05:00
|
|
|
<RootView />
|
2021-01-08 12:30:05 +05:00
|
|
|
<EditorRoot />
|
2020-11-23 11:30:55 +05:00
|
|
|
</SafeAreaProvider>
|
2020-10-24 13:47:31 +05:00
|
|
|
);
|
2019-11-15 01:17:59 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default App;
|