fix useEffects recurring

This commit is contained in:
ammarahm-ed
2020-05-08 23:43:38 +05:00
parent 8aa3ac2df7
commit 21a533b612
7 changed files with 8 additions and 8 deletions

View File

@@ -60,7 +60,7 @@ const App = () => {
return () => {
eUnSubscribeEvent(eStartSyncer, startSyncer);
};
});
},[]);
useEffect(() => {
Initialize().then(() => {
@@ -68,6 +68,7 @@ const App = () => {
let user = await db.user.get();
startSyncer();
dispatch({type: ACTIONS.USER, user: user});
dispatch({type: ACTIONS.ALL});
setInit(true);
});
});

View File

@@ -174,7 +174,7 @@ export const Container = ({
return () => {
eUnSubscribeEvent(eScrollEvent, onScroll);
};
});
},[]);
// Render

View File

@@ -16,7 +16,7 @@ export const TimeSince = ({time}) => {
clearInterval(interval);
interval = null;
};
});
},[]);
return <Text>{timeAgo}</Text>;
};

View File

@@ -216,7 +216,7 @@ const MergeEditor = () => {
eUnSubscribeEvent(eApplyChanges, applyChanges);
eUnSubscribeEvent(eShowMergeDialog, show);
};
});
},[]);
const onPressKeepFromPrimaryWebView = () => {
if (keepContentFrom == 'primary') {

View File

@@ -16,7 +16,6 @@ export const SelectionHeader = () => {
const {colors, selectionMode, selectedItemsList, currentScreen} = state;
const [selectAll, setSelectAll] = useState(false);
useEffect(() => {}, [currentScreen]);
return (
<Animatable.View

View File

@@ -1,4 +1,4 @@
import { StackActions } from '@react-navigation/routers';
import { StackActions } from '@react-navigation/native';
import { rootNavigatorRef } from '../utils/refs';
function navigate(name, params) {

View File

@@ -449,7 +449,7 @@ const Editor = ({noMenu}) => {
return () => {
eUnSubscribeEvent(eCloseFullscreenEditor, closeFullscreen);
};
});
},[]);
const _onHardwareBackPress = async () => {
if (editing.currentlyEditing) {