This commit is contained in:
ammarahm-ed
2020-11-20 02:38:09 +05:00
parent 7f61e8e7d8
commit acdc9898e9
4 changed files with 32 additions and 48 deletions

View File

@@ -90,20 +90,6 @@ const App = () => {
const [, dispatch] = useTracked(), const [, dispatch] = useTracked(),
[init, setInit] = useState(false); [init, setInit] = useState(false);
const _onOrientationChange = (o) => {
return;
/* let smallTab = DDS.isSmallTab;
DDS.setNewValues();
DDS.checkSmallTab(o);
if (smallTab === DDS.isSmallTab) {
return;
}
I = DDS.isLargeTablet() ? require('./index.tablet') : require('./RootView');
setTimeout(() => {
resetApp();
}, 1000); */
};
const syncChanges = async () => { const syncChanges = async () => {
dispatch({type: Actions.ALL}); dispatch({type: Actions.ALL});
}, },
@@ -139,7 +125,6 @@ const App = () => {
useEffect(() => { useEffect(() => {
eSubscribeEvent(eStartSyncer, startSyncer); eSubscribeEvent(eStartSyncer, startSyncer);
eSubscribeEvent(eResetApp, resetApp); eSubscribeEvent(eResetApp, resetApp);
Orientation.addOrientationListener(_onOrientationChange);
eSubscribeEvent(eDispatchAction, (type) => { eSubscribeEvent(eDispatchAction, (type) => {
dispatch(type); dispatch(type);
}); });
@@ -153,7 +138,6 @@ const App = () => {
eUnSubscribeEvent(eDispatchAction, (type) => { eUnSubscribeEvent(eDispatchAction, (type) => {
dispatch(type); dispatch(type);
}); });
Orientation.removeOrientationListener(_onOrientationChange);
AppState.removeEventListener('change', onAppStateChanged); AppState.removeEventListener('change', onAppStateChanged);
Appearance.removeChangeListener(onSystemThemeChanged); Appearance.removeChangeListener(onSystemThemeChanged);
unsub(); unsub();

View File

@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import {FlatList, Platform, Text, View} from 'react-native'; import { FlatList, Platform, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useSafeAreaInsets } from 'react-native-safe-area-context';
import RNFetchBlob from 'rn-fetch-blob'; import RNFetchBlob from 'rn-fetch-blob';
import { useTracked } from '../../provider'; import { useTracked } from '../../provider';
@@ -8,12 +8,12 @@ import {DDS} from '../../services/DeviceDetection';
import { import {
eSubscribeEvent, eSubscribeEvent,
eUnSubscribeEvent, eUnSubscribeEvent,
ToastEvent, ToastEvent
} from '../../services/EventManager'; } from '../../services/EventManager';
import { getElevation } from '../../utils'; import { getElevation } from '../../utils';
import { db } from '../../utils/DB'; import { db } from '../../utils/DB';
import { eCloseRestoreDialog, eOpenRestoreDialog } from '../../utils/Events'; import { eCloseRestoreDialog, eOpenRestoreDialog } from '../../utils/Events';
import {ph, SIZE, WEIGHT} from '../../utils/SizeUtils'; import { ph, SIZE } from '../../utils/SizeUtils';
import storage from '../../utils/storage'; import storage from '../../utils/storage';
import { sleep } from '../../utils/TimeUtils'; import { sleep } from '../../utils/TimeUtils';
import { Button } from '../Button'; import { Button } from '../Button';
@@ -132,6 +132,7 @@ const RestoreDialog = () => {
maxHeight: '85%', maxHeight: '85%',
}}> }}>
<FlatList <FlatList
data={files} data={files}
keyExtractor={(item, index) => item.filename} keyExtractor={(item, index) => item.filename}
renderItem={({item, index}) => ( renderItem={({item, index}) => (

View File

@@ -3,9 +3,9 @@ import {
Platform, Platform,
RefreshControl, RefreshControl,
StyleSheet, StyleSheet,
Text,
useWindowDimensions, useWindowDimensions,
View, View
} from 'react-native'; } from 'react-native';
import { DataProvider, LayoutProvider, RecyclerListView } from 'recyclerlistview'; import { DataProvider, LayoutProvider, RecyclerListView } from 'recyclerlistview';
import { useTracked } from '../../provider'; import { useTracked } from '../../provider';
@@ -16,9 +16,9 @@ import {db} from '../../utils/DB';
import { import {
eOpenJumpToDialog, eOpenJumpToDialog,
eOpenLoginDialog, eOpenLoginDialog,
eScrollEvent, eScrollEvent
} from '../../utils/Events'; } from '../../utils/Events';
import {SIZE, WEIGHT} from '../../utils/SizeUtils'; import { SIZE } from '../../utils/SizeUtils';
import { Button } from '../Button'; import { Button } from '../Button';
import { HeaderMenu } from '../Header/HeaderMenu'; import { HeaderMenu } from '../Header/HeaderMenu';
import Seperator from '../Seperator'; import Seperator from '../Seperator';

View File

@@ -24,8 +24,7 @@ export const injectedJS = ` setTimeout(() => {
link.href = './site/index.html?${params}'; link.href = './site/index.html?${params}';
link.click(); link.click();
} }
},1000); },100);
true;
`; `;