mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
clean up
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
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';
|
||||||
import {Actions} from '../../provider/Actions';
|
import { Actions } from '../../provider/Actions';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
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';
|
||||||
import BaseDialog from '../Dialog/base-dialog';
|
import BaseDialog from '../Dialog/base-dialog';
|
||||||
import DialogButtons from '../Dialog/dialog-buttons';
|
import DialogButtons from '../Dialog/dialog-buttons';
|
||||||
import DialogHeader from '../Dialog/dialog-header';
|
import DialogHeader from '../Dialog/dialog-header';
|
||||||
import {Loading} from '../Loading';
|
import { Loading } from '../Loading';
|
||||||
import Paragraph from '../Typography/Paragraph';
|
import Paragraph from '../Typography/Paragraph';
|
||||||
|
|
||||||
const RestoreDialog = () => {
|
const RestoreDialog = () => {
|
||||||
@@ -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}) => (
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
import React, {useCallback, useEffect, useState} from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import {
|
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';
|
||||||
import {Actions} from '../../provider/Actions';
|
import { Actions } from '../../provider/Actions';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import { DDS } from '../../services/DeviceDetection';
|
||||||
import {eSendEvent, ToastEvent} from '../../services/EventManager';
|
import { eSendEvent, ToastEvent } from '../../services/EventManager';
|
||||||
import {db} from '../../utils/DB';
|
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';
|
||||||
import TagItem from '../TagItem';
|
import TagItem from '../TagItem';
|
||||||
import Heading from '../Typography/Heading';
|
import Heading from '../Typography/Heading';
|
||||||
import Paragraph from '../Typography/Paragraph';
|
import Paragraph from '../Typography/Paragraph';
|
||||||
import {ListHeaderComponent} from './ListHeaderComponent';
|
import { ListHeaderComponent } from './ListHeaderComponent';
|
||||||
import {NotebookItemWrapper} from './NotebookItemWrapper';
|
import { NotebookItemWrapper } from './NotebookItemWrapper';
|
||||||
import {NoteItemWrapper} from './NoteItemWrapper';
|
import { NoteItemWrapper } from './NoteItemWrapper';
|
||||||
|
|
||||||
const header = {
|
const header = {
|
||||||
type: 'MAIN_HEADER',
|
type: 'MAIN_HEADER',
|
||||||
|
|||||||
@@ -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;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user