remove console.logs

This commit is contained in:
ammarahm-ed
2020-09-19 16:04:22 +05:00
parent 68d716ae26
commit f52a0328a9
11 changed files with 68 additions and 153 deletions

View File

@@ -61,3 +61,4 @@ buck-out/
# Other # Other
react-native-mmkv-storage/ react-native-mmkv-storage/
react-native-eventsource/

View File

@@ -1848,7 +1848,7 @@
} }
document.getElementById(dropdown).style.top = dropDownTop; document.getElementById(dropdown).style.top = dropDownTop;
document.getElementById(dropdown).style.left = left; document.getElementById(dropdown).style.left = left;
console.log(dropDownTop, left);
//dropdown.css('top', dropDownTop + 'px'); //dropdown.css('top', dropDownTop + 'px');
//dropdown.css('left', left + 'px'); //dropdown.css('left', left + 'px');
@@ -1860,11 +1860,10 @@
let downTop = let downTop =
currentTop - b.offsetHeight - height; currentTop - b.offsetHeight - height;
console.log(downTop, 'nat')
document.getElementById(dropdown).style.top = downTop + 20; document.getElementById(dropdown).style.top = downTop + 20;
document.getElementById(dropdown).style.left = left; document.getElementById(dropdown).style.left = left;
//console.log('called',downTop + 20,left);
}) })
} }

View File

@@ -154,7 +154,6 @@ export class AddNotebookDialog extends React.Component {
let nextTopics = toEdit.topics.map((topic, index) => { let nextTopics = toEdit.topics.map((topic, index) => {
if (index === 0) return topic; if (index === 0) return topic;
let copy = {...topic}; let copy = {...topic};
console.log(copy, 'here');
copy.title = prevTopics[index - 1]; copy.title = prevTopics[index - 1];
return copy; return copy;
}); });
@@ -164,7 +163,6 @@ export class AddNotebookDialog extends React.Component {
nextTopics.push(title); nextTopics.push(title);
} }
}); });
console.log(nextTopics, prevTopics, toEdit.topics, 'HERE');
await db.notebooks.notebook(id).topics.add(...nextTopics); await db.notebooks.notebook(id).topics.add(...nextTopics);
} else { } else {
await db.notebooks.add({ await db.notebooks.add({

View File

@@ -31,7 +31,7 @@ export class AddTopicDialog extends React.Component {
} else { } else {
let topic = this.props.toEdit; let topic = this.props.toEdit;
topic.title = this.title; topic.title = this.title;
console.log(topic);
await db.notebooks.notebook(topic.notebookId).topics.add(topic); await db.notebooks.notebook(topic.notebookId).topics.add(topic);
} }
this.close(); this.close();

View File

@@ -87,7 +87,6 @@ export class Dialog extends Component {
'global', 'global',
6000, 6000,
async () => { async () => {
console.log('COPY');
let trash = db.trash; let trash = db.trash;
for (var i = 0; i < itemsCopy.length; i++) { for (var i = 0; i < itemsCopy.length; i++) {

View File

@@ -15,7 +15,7 @@ export const ColorSection = ({noTextMode}) => {
const {colors, colorNotes, currentScreen} = state; const {colors, colorNotes, currentScreen} = state;
useEffect(() => { useEffect(() => {
console.log(colorNotes[0]);
dispatch({type: ACTIONS.TAGS}); dispatch({type: ACTIONS.TAGS});
}, []); }, []);

View File

@@ -76,7 +76,7 @@ const MoveNoteDialog = () => {
} }
let res = await db.notebooks.notebook(expanded).topics.add(newTopicTitle); let res = await db.notebooks.notebook(expanded).topics.add(newTopicTitle);
console.log(newTopicTitle, res);
dispatch({type: ACTIONS.NOTEBOOKS}); dispatch({type: ACTIONS.NOTEBOOKS});
dispatch({type: ACTIONS.PINNED}); dispatch({type: ACTIONS.PINNED});
topicInput.current?.clear(); topicInput.current?.clear();
@@ -358,8 +358,7 @@ const MoveNoteDialog = () => {
onPress={async () => { onPress={async () => {
let noteIds = []; let noteIds = [];
selectedItemsList.forEach((i) => noteIds.push(i.id)); selectedItemsList.forEach((i) => noteIds.push(i.id));
console.log(selectedItemsList[0]);
console.log(noteIds, 'NOTE IDS');
let res = await db.notes.move( let res = await db.notes.move(
{ {
topic: item.title, topic: item.title,
@@ -367,7 +366,6 @@ const MoveNoteDialog = () => {
}, },
...noteIds, ...noteIds,
); );
console.log(res);
dispatch({type: ACTIONS.CLEAR_SELECTION}); dispatch({type: ACTIONS.CLEAR_SELECTION});
dispatch({type: ACTIONS.NOTEBOOKS}); dispatch({type: ACTIONS.NOTEBOOKS});
dispatch({type: ACTIONS.PINNED}); dispatch({type: ACTIONS.PINNED});

View File

@@ -31,7 +31,6 @@ export const Search = (props) => {
const animation = (margin, opacity, border) => { const animation = (margin, opacity, border) => {
if (animating) return; if (animating) return;
animating = true; animating = true;
console.log('animating');
timing(_marginAnim, { timing(_marginAnim, {
toValue: margin, toValue: margin,
duration: 230, duration: 230,
@@ -68,7 +67,7 @@ export const Search = (props) => {
timeoutAnimate = null; timeoutAnimate = null;
timeoutAnimate = setTimeout(() => { timeoutAnimate = setTimeout(() => {
animation(-65, 0, 0); animation(-65, 0, 0);
console.log('up');
}, 500); }, 500);
offsetY = y; offsetY = y;
} else { } else {
@@ -76,7 +75,7 @@ export const Search = (props) => {
clearTimeout(timeoutAnimate); clearTimeout(timeoutAnimate);
timeoutAnimate = null; timeoutAnimate = null;
timeoutAnimate = setTimeout(() => { timeoutAnimate = setTimeout(() => {
console.log('down');
animation(0, 1, 1.5); animation(0, 1, 1.5);
}, 500); }, 500);
offsetY = y; offsetY = y;

View File

@@ -17,7 +17,6 @@ async function read(key, isArray = false) {
if (!data) return null; if (!data) return null;
try { try {
data = JSON.parse(data); data = JSON.parse(data);
console.log(isArray? data: null, "ARRAY");
data = isArray? [...data] : data; data = isArray? [...data] : data;
} catch (e) { } catch (e) {
@@ -28,7 +27,6 @@ async function read(key, isArray = false) {
} }
async function write(key, data) { async function write(key, data) {
console.log(key,data,"DATA_WRITE");
return await MMKV.setItem( return await MMKV.setItem(
key, key,
typeof data === 'string' ? data : JSON.stringify(data), typeof data === 'string' ? data : JSON.stringify(data),
@@ -36,7 +34,6 @@ async function write(key, data) {
} }
async function readMulti(keys) { async function readMulti(keys) {
console.log(keys,"KEYS");
if (keys.length <= 0) { if (keys.length <= 0) {
return []; return [];
} else { } else {
@@ -53,7 +50,7 @@ async function readMulti(keys) {
return [key, obj]; return [key, obj];
}) })
console.log(map,"DATA");
return map; return map;
} }

View File

@@ -305,86 +305,7 @@ export const Login = ({route, navigation}) => {
placeholderTextColor={colors.icon} placeholderTextColor={colors.icon}
/> />
{/* <Text
style={{
textAlign: 'right',
marginHorizontal: 12,
fontFamily: WEIGHT.regular,
textAlignVertical: 'bottom',
position: 'absolute',
right: 5,
top: 2.5,
}}>
{invalidEmail ? (
<Icon name="alert-circle" size={SIZE.xs} color={colors.errorText} />
) : null}
</Text>
<TextInput
ref={_email}
onFocus={() => {
if (!invalidEmail) {
_email.current.setNativeProps({
style: {
borderColor: colors.accent,
},
});
}
}}
defaultValue={email}
onBlur={() => {
if (!validateEmail(email)) {
setInvalidEmail(true);
_email.current.setNativeProps({
style: {
color: colors.errorText,
borderColor: colors.errorText,
},
});
} else {
_email.current.setNativeProps({
style: {
borderColor: colors.nav,
},
});
}
}}
textContentType="emailAddress"
onChangeText={value => {
setEmail(value);
if (invalidEmail && validateEmail(email)) {
setInvalidEmail(false);
_email.current.setNativeProps({
style: {
color: colors.pri,
borderColor: colors.accent,
},
});
}
}}
onSubmitEditing={() => {
if (!validateEmail(email)) {
setInvalidEmail(true);
_email.current.setNativeProps({
style: {
color: colors.errorText,
},
});
}
}}
style={{
padding: pv,
borderWidth: 1.5,
borderColor: colors.nav,
marginHorizontal: 12,
borderRadius: 5,
fontSize: SIZE.sm,
fontFamily: WEIGHT.regular,
}}
placeholder="Email"
placeholderTextColor={colors.icon}
/> */}
{invalidUsername ? ( {invalidUsername ? (
<Text <Text
style={{ style={{
@@ -404,6 +325,7 @@ export const Login = ({route, navigation}) => {
) : null} ) : null}
<Seperator /> <Seperator />
<View <View
ref={_passContainer} ref={_passContainer}
style={{ style={{
@@ -446,7 +368,6 @@ export const Login = ({route, navigation}) => {
}} }}
onChangeText={(value) => { onChangeText={(value) => {
setPassword(value); setPassword(value);
console.log(value, 'VALUE');
if (invalidPassword && validatePass(password)) { if (invalidPassword && validatePass(password)) {
setInvalidPassword(false); setInvalidPassword(false);

View File

@@ -35,7 +35,7 @@ import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import {eOpenLoginDialog, eResetApp} from '../../services/events'; import {eOpenLoginDialog, eResetApp} from '../../services/events';
import NavigationService from '../../services/NavigationService'; import NavigationService from '../../services/NavigationService';
import {MMKV} from '../../utils/storage'; import storage, {MMKV} from '../../utils/storage';
import { import {
db, db,
DDS, DDS,
@@ -316,18 +316,10 @@ export const Settings = ({route, navigation}) => {
}}> }}>
{user ? ( {user ? (
<> <>
<SectionHeader title="Account Settings" /> <View
<Text
style={{ style={{
fontSize: SIZE.sm, paddingHorizontal: 12,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
marginTop: pv + 5,
}}> }}>
Logged in as:
</Text>
<View <View
style={{ style={{
justifyContent: 'space-between', justifyContent: 'space-between',
@@ -336,7 +328,7 @@ export const Settings = ({route, navigation}) => {
flexDirection: 'row', flexDirection: 'row',
width: '100%', width: '100%',
paddingVertical: pv, paddingVertical: pv,
marginBottom: pv + 5, marginBottom: pv,
marginTop: pv, marginTop: pv,
backgroundColor: colors.accent, backgroundColor: colors.accent,
borderRadius: 5, borderRadius: 5,
@@ -378,7 +370,7 @@ export const Settings = ({route, navigation}) => {
</Text> </Text>
</View> </View>
</View> </View>
</View>
{[ {[
{ {
name: 'Data recovery key', name: 'Data recovery key',
@@ -387,10 +379,13 @@ export const Settings = ({route, navigation}) => {
setKey(k.key); setKey(k.key);
setModalVisible(true); setModalVisible(true);
}, },
desc:
'Generate a data recovery key to recovery your data if you lose it',
}, },
{ {
name: 'Subscription status', name: 'Subscription status',
func: () => {}, func: () => {},
desc: 'Current status of your subscription',
}, },
{ {
name: 'Logout', name: 'Logout',
@@ -398,11 +393,19 @@ export const Settings = ({route, navigation}) => {
await db.user.logout(); await db.user.logout();
dispatch({type: ACTIONS.USER, user: null}); dispatch({type: ACTIONS.USER, user: null});
dispatch({type: ACTIONS.CLEAR_ALL}); dispatch({type: ACTIONS.CLEAR_ALL});
ToastEvent.show('Logged out, syncing disabled', 'success'); //ToastEvent.show('Logged out, syncing disabled', 'success');
eSendEvent(eResetApp);
}, },
desc:
'Logout of your account, this will clear everything and reset the app.',
}, },
].map((item) => ( ].map((item) => (
<Button key={item.name} title={item.name} onPress={item.func} /> <Button
key={item.name}
title={item.name}
onPress={item.func}
tagline={item.desc}
/>
))} ))}
</> </>
) : ( ) : (
@@ -435,7 +438,7 @@ export const Settings = ({route, navigation}) => {
width: 40, width: 40,
backgroundColor: colors.accent, backgroundColor: colors.accent,
height: 40, height: 40,
marginLeft:10, marginLeft: 10,
borderRadius: 100, borderRadius: 100,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',