Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

remove console.logs

ammarahm-edf52a0328a9f2
diff --git a/apps/mobile/.gitignore b/apps/mobile/.gitignore
index ab3f579e9..d29466c17 100644
--- a/apps/mobile/.gitignore
+++ b/apps/mobile/.gitignore
@@ -61,3 +61,4 @@ buck-out/
# Other
react-native-mmkv-storage/
+react-native-eventsource/
diff --git a/apps/mobile/html/Web.bundle/site/index.html b/apps/mobile/html/Web.bundle/site/index.html
index 0eda6435c..e45239e6d 100644
--- a/apps/mobile/html/Web.bundle/site/index.html
+++ b/apps/mobile/html/Web.bundle/site/index.html
@@ -1848,7 +1848,7 @@
}
document.getElementById(dropdown).style.top = dropDownTop;
document.getElementById(dropdown).style.left = left;
- console.log(dropDownTop, left);
+
//dropdown.css('top', dropDownTop + 'px');
//dropdown.css('left', left + 'px');
@@ -1860,11 +1860,10 @@
let downTop =
currentTop - b.offsetHeight - height;
- console.log(downTop, 'nat')
document.getElementById(dropdown).style.top = downTop + 20;
document.getElementById(dropdown).style.left = left;
- //console.log('called',downTop + 20,left);
+
})
}
diff --git a/apps/mobile/src/components/AddNotebookDialog/index.js b/apps/mobile/src/components/AddNotebookDialog/index.js
index 348bd13c9..23840d1bc 100644
--- a/apps/mobile/src/components/AddNotebookDialog/index.js
+++ b/apps/mobile/src/components/AddNotebookDialog/index.js
@@ -154,7 +154,6 @@ export class AddNotebookDialog extends React.Component {
let nextTopics = toEdit.topics.map((topic, index) => {
if (index === 0) return topic;
let copy = {...topic};
- console.log(copy, 'here');
copy.title = prevTopics[index - 1];
return copy;
});
@@ -164,7 +163,6 @@ export class AddNotebookDialog extends React.Component {
nextTopics.push(title);
}
});
- console.log(nextTopics, prevTopics, toEdit.topics, 'HERE');
await db.notebooks.notebook(id).topics.add(...nextTopics);
} else {
await db.notebooks.add({
diff --git a/apps/mobile/src/components/AddTopicDialog/index.js b/apps/mobile/src/components/AddTopicDialog/index.js
index ecf081cf3..137a63b6f 100644
--- a/apps/mobile/src/components/AddTopicDialog/index.js
+++ b/apps/mobile/src/components/AddTopicDialog/index.js
@@ -31,7 +31,7 @@ export class AddTopicDialog extends React.Component {
} else {
let topic = this.props.toEdit;
topic.title = this.title;
- console.log(topic);
+
await db.notebooks.notebook(topic.notebookId).topics.add(topic);
}
this.close();
diff --git a/apps/mobile/src/components/Dialog/index.js b/apps/mobile/src/components/Dialog/index.js
index 342712091..2f8b9b247 100644
--- a/apps/mobile/src/components/Dialog/index.js
+++ b/apps/mobile/src/components/Dialog/index.js
@@ -87,7 +87,6 @@ export class Dialog extends Component {
'global',
6000,
async () => {
- console.log('COPY');
let trash = db.trash;
for (var i = 0; i < itemsCopy.length; i++) {
diff --git a/apps/mobile/src/components/Menu/ColorSection.js b/apps/mobile/src/components/Menu/ColorSection.js
index ec4139e84..2b714daf4 100644
--- a/apps/mobile/src/components/Menu/ColorSection.js
+++ b/apps/mobile/src/components/Menu/ColorSection.js
@@ -15,7 +15,7 @@ export const ColorSection = ({noTextMode}) => {
const {colors, colorNotes, currentScreen} = state;
useEffect(() => {
- console.log(colorNotes[0]);
+
dispatch({type: ACTIONS.TAGS});
}, []);
diff --git a/apps/mobile/src/components/MoveNoteDialog/index.js b/apps/mobile/src/components/MoveNoteDialog/index.js
index d413d2765..030bcd990 100644
--- a/apps/mobile/src/components/MoveNoteDialog/index.js
+++ b/apps/mobile/src/components/MoveNoteDialog/index.js
@@ -76,7 +76,7 @@ const MoveNoteDialog = () => {
}
let res = await db.notebooks.notebook(expanded).topics.add(newTopicTitle);
- console.log(newTopicTitle, res);
+
dispatch({type: ACTIONS.NOTEBOOKS});
dispatch({type: ACTIONS.PINNED});
topicInput.current?.clear();
@@ -358,8 +358,7 @@ const MoveNoteDialog = () => {
onPress={async () => {
let noteIds = [];
selectedItemsList.forEach((i) => noteIds.push(i.id));
- console.log(selectedItemsList[0]);
- console.log(noteIds, 'NOTE IDS');
+
let res = await db.notes.move(
{
topic: item.title,
@@ -367,7 +366,6 @@ const MoveNoteDialog = () => {
},
...noteIds,
);
- console.log(res);
dispatch({type: ACTIONS.CLEAR_SELECTION});
dispatch({type: ACTIONS.NOTEBOOKS});
dispatch({type: ACTIONS.PINNED});
diff --git a/apps/mobile/src/components/SearchInput/index.js b/apps/mobile/src/components/SearchInput/index.js
index 0ffee8730..18d013654 100644
--- a/apps/mobile/src/components/SearchInput/index.js
+++ b/apps/mobile/src/components/SearchInput/index.js
@@ -31,7 +31,6 @@ export const Search = (props) => {
const animation = (margin, opacity, border) => {
if (animating) return;
animating = true;
- console.log('animating');
timing(_marginAnim, {
toValue: margin,
duration: 230,
@@ -68,7 +67,7 @@ export const Search = (props) => {
timeoutAnimate = null;
timeoutAnimate = setTimeout(() => {
animation(-65, 0, 0);
- console.log('up');
+
}, 500);
offsetY = y;
} else {
@@ -76,7 +75,7 @@ export const Search = (props) => {
clearTimeout(timeoutAnimate);
timeoutAnimate = null;
timeoutAnimate = setTimeout(() => {
- console.log('down');
+
animation(0, 1, 1.5);
}, 500);
offsetY = y;
diff --git a/apps/mobile/src/utils/storage.js b/apps/mobile/src/utils/storage.js
index 2a3cf7c5d..b2bb20bd5 100644
--- a/apps/mobile/src/utils/storage.js
+++ b/apps/mobile/src/utils/storage.js
@@ -17,7 +17,6 @@ async function read(key, isArray = false) {
if (!data) return null;
try {
data = JSON.parse(data);
- console.log(isArray? data: null, "ARRAY");
data = isArray? [...data] : data;
} catch (e) {
@@ -28,7 +27,6 @@ async function read(key, isArray = false) {
}
async function write(key, data) {
- console.log(key,data,"DATA_WRITE");
return await MMKV.setItem(
key,
typeof data === 'string' ? data : JSON.stringify(data),
@@ -36,7 +34,6 @@ async function write(key, data) {
}
async function readMulti(keys) {
- console.log(keys,"KEYS");
if (keys.length <= 0) {
return [];
} else {
@@ -53,7 +50,7 @@ async function readMulti(keys) {
return [key, obj];
})
- console.log(map,"DATA");
+
return map;
}
diff --git a/apps/mobile/src/views/Login/index.js b/apps/mobile/src/views/Login/index.js
index 970b614a4..0d6d3bcf3 100644
--- a/apps/mobile/src/views/Login/index.js
+++ b/apps/mobile/src/views/Login/index.js
@@ -305,86 +305,7 @@ export const Login = ({route, navigation}) => {
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 ? (
<Text
style={{
@@ -404,6 +325,7 @@ export const Login = ({route, navigation}) => {
) : null}
<Seperator />
+
<View
ref={_passContainer}
style={{
@@ -446,7 +368,6 @@ export const Login = ({route, navigation}) => {
}}
onChangeText={(value) => {
setPassword(value);
- console.log(value, 'VALUE');
if (invalidPassword && validatePass(password)) {
setInvalidPassword(false);
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index b201b7306..a9d2fc1a7 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -35,7 +35,7 @@ import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager';
import {eOpenLoginDialog, eResetApp} from '../../services/events';
import NavigationService from '../../services/NavigationService';
-import {MMKV} from '../../utils/storage';
+import storage, {MMKV} from '../../utils/storage';
import {
db,
DDS,
@@ -316,69 +316,61 @@ export const Settings = ({route, navigation}) => {
}}>
{user ? (
<>
- <SectionHeader title="Account Settings" />
- <Text
- style={{
- fontSize: SIZE.sm,
- fontFamily: WEIGHT.regular,
- textAlignVertical: 'center',
- color: colors.pri,
- marginTop: pv + 5,
- }}>
- Logged in as:
- </Text>
-
<View
style={{
- justifyContent: 'space-between',
- alignItems: 'center',
- alignSelf: 'center',
- flexDirection: 'row',
- width: '100%',
- paddingVertical: pv,
- marginBottom: pv + 5,
- marginTop: pv,
- backgroundColor: colors.accent,
- borderRadius: 5,
- padding: 5,
paddingHorizontal: 12,
}}>
<View
style={{
- flexDirection: 'row',
- justifyContent: 'center',
+ justifyContent: 'space-between',
alignItems: 'center',
- }}>
- <Icon size={SIZE.lg} color="white" name="account-outline" />
-
- <Text
- style={{
- color: 'white',
- marginLeft: 5,
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- }}>
- {user.username}
- </Text>
- </View>
- <View
- style={{
+ alignSelf: 'center',
+ flexDirection: 'row',
+ width: '100%',
+ paddingVertical: pv,
+ marginBottom: pv,
+ marginTop: pv,
+ backgroundColor: colors.accent,
borderRadius: 5,
padding: 5,
- paddingVertical: 2.5,
- backgroundColor: 'white',
+ paddingHorizontal: 12,
}}>
- <Text
+ <View
style={{
- color: colors.accent,
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xs,
+ flexDirection: 'row',
+ justifyContent: 'center',
+ alignItems: 'center',
}}>
- Pro
- </Text>
+ <Icon size={SIZE.lg} color="white" name="account-outline" />
+
+ <Text
+ style={{
+ color: 'white',
+ marginLeft: 5,
+ fontFamily: WEIGHT.regular,
+ fontSize: SIZE.sm,
+ }}>
+ {user.username}
+ </Text>
+ </View>
+ <View
+ style={{
+ borderRadius: 5,
+ padding: 5,
+ paddingVertical: 2.5,
+ backgroundColor: 'white',
+ }}>
+ <Text
+ style={{
+ color: colors.accent,
+ fontFamily: WEIGHT.regular,
+ fontSize: SIZE.xs,
+ }}>
+ Pro
+ </Text>
+ </View>
</View>
</View>
-
{[
{
name: 'Data recovery key',
@@ -387,10 +379,13 @@ export const Settings = ({route, navigation}) => {
setKey(k.key);
setModalVisible(true);
},
+ desc:
+ 'Generate a data recovery key to recovery your data if you lose it',
},
{
name: 'Subscription status',
func: () => {},
+ desc: 'Current status of your subscription',
},
{
name: 'Logout',
@@ -398,11 +393,19 @@ export const Settings = ({route, navigation}) => {
await db.user.logout();
dispatch({type: ACTIONS.USER, user: null});
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) => (
- <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,
backgroundColor: colors.accent,
height: 40,
- marginLeft:10,
+ marginLeft: 10,
borderRadius: 100,
alignItems: 'center',
justifyContent: 'center',