mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
fix useEffects recurring
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -174,7 +174,7 @@ export const Container = ({
|
||||
return () => {
|
||||
eUnSubscribeEvent(eScrollEvent, onScroll);
|
||||
};
|
||||
});
|
||||
},[]);
|
||||
|
||||
// Render
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export const TimeSince = ({time}) => {
|
||||
clearInterval(interval);
|
||||
interval = null;
|
||||
};
|
||||
});
|
||||
},[]);
|
||||
|
||||
return <Text>{timeAgo}</Text>;
|
||||
};
|
||||
|
||||
@@ -216,7 +216,7 @@ const MergeEditor = () => {
|
||||
eUnSubscribeEvent(eApplyChanges, applyChanges);
|
||||
eUnSubscribeEvent(eShowMergeDialog, show);
|
||||
};
|
||||
});
|
||||
},[]);
|
||||
|
||||
const onPressKeepFromPrimaryWebView = () => {
|
||||
if (keepContentFrom == 'primary') {
|
||||
|
||||
@@ -16,7 +16,6 @@ export const SelectionHeader = () => {
|
||||
const {colors, selectionMode, selectedItemsList, currentScreen} = state;
|
||||
const [selectAll, setSelectAll] = useState(false);
|
||||
|
||||
useEffect(() => {}, [currentScreen]);
|
||||
|
||||
return (
|
||||
<Animatable.View
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { StackActions } from '@react-navigation/routers';
|
||||
import { StackActions } from '@react-navigation/native';
|
||||
import { rootNavigatorRef } from '../utils/refs';
|
||||
|
||||
function navigate(name, params) {
|
||||
rootNavigatorRef .current?.navigate(name, params);
|
||||
rootNavigatorRef.current?.navigate(name, params);
|
||||
}
|
||||
function goBack() {
|
||||
rootNavigatorRef.current?.goBack();
|
||||
|
||||
@@ -449,7 +449,7 @@ const Editor = ({noMenu}) => {
|
||||
return () => {
|
||||
eUnSubscribeEvent(eCloseFullscreenEditor, closeFullscreen);
|
||||
};
|
||||
});
|
||||
},[]);
|
||||
|
||||
const _onHardwareBackPress = async () => {
|
||||
if (editing.currentlyEditing) {
|
||||
|
||||
Reference in New Issue
Block a user