remove console.log

This commit is contained in:
ammarahm-ed
2020-11-20 02:43:07 +05:00
parent acdc9898e9
commit a7f1805ffa
31 changed files with 23 additions and 78 deletions

View File

@@ -53,7 +53,6 @@ let {width, height} = Dimensions.get('window');
const onAppStateChanged = async (state) => { const onAppStateChanged = async (state) => {
if (state === 'active') { if (state === 'active') {
console.log('active state');
StatusBar.setBarStyle( StatusBar.setBarStyle(
COLOR_SCHEME.night ? 'light-content' : 'dark-content', COLOR_SCHEME.night ? 'light-content' : 'dark-content',
true, true,
@@ -164,7 +163,6 @@ const App = () => {
(async () => { (async () => {
try { try {
await db.init(); await db.init();
console.log('db is initialized');
} catch (e) { } catch (e) {
error = e; error = e;
console.log(e, 'ERROR DB'); console.log(e, 'ERROR DB');

View File

@@ -29,7 +29,6 @@ import {getIntent, getNote, post} from './src/views/Editor/Functions';
let {width, height} = Dimensions.get('window'); let {width, height} = Dimensions.get('window');
const onChangeTab = async (obj) => { const onChangeTab = async (obj) => {
console.log('tab changed');
if (obj.i === 1) { if (obj.i === 1) {
eSendEvent(eCloseSideMenu); eSendEvent(eCloseSideMenu);
if (getIntent()) return; if (getIntent()) return;

View File

@@ -513,7 +513,7 @@ function fixDropdownMenuLocations() {
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

@@ -445,7 +445,7 @@ function fixDropdownMenuLocations() {
if (!evt.target.offsetParent) { if (!evt.target.offsetParent) {
let _myLocalElement = evt.target.parentElement; let _myLocalElement = evt.target.parentElement;
console.log(_myLocalElement)
var rect = _myLocalElement.getBoundingClientRect(); var rect = _myLocalElement.getBoundingClientRect();
evtItemWidth = _myLocalElement.offsetParent.offsetWidth; evtItemWidth = _myLocalElement.offsetParent.offsetWidth;
evtItemHeight = _myLocalElement.offsetParent.offsetHeight; evtItemHeight = _myLocalElement.offsetParent.offsetHeight;
@@ -479,7 +479,6 @@ function fixDropdownMenuLocations() {
left = left - (wDiff / 2); left = left - (wDiff / 2);
} }
console.log('position changing')
dropDownFixPosition( dropDownFixPosition(
'.ql-picker-label', '.ql-picker-label',

View File

@@ -45,7 +45,7 @@ export const ActionSheetTagsSection = ({item, close}) => {
const _onSubmit = useCallback(async () => { const _onSubmit = useCallback(async () => {
if (!tagToAdd || tagToAdd === '' || tagToAdd.trimStart().length == 0) { if (!tagToAdd || tagToAdd === '' || tagToAdd.trimStart().length == 0) {
console.log('Calling submit', tagToAdd);
ToastEvent.show('Empty Tag', 'error', 'local'); ToastEvent.show('Empty Tag', 'error', 'local');
return; return;
} }

View File

@@ -424,12 +424,6 @@ export const ActionSheetComponent = ({
dispatch({type: Actions.ALL}); dispatch({type: Actions.ALL});
setRefreshing(false); setRefreshing(false);
} }
} else {
console.log(
'here',
user?.lastSynced,
user?.lastSynced < note?.dateEdited,
);
} }
}; };

View File

@@ -64,7 +64,6 @@ export class AddNotebookDialog extends React.Component {
if (index === 0) return; if (index === 0) return;
topicsList.push(item.title); topicsList.push(item.title);
}); });
console.log(topicsList);
this.id = toEdit.id; this.id = toEdit.id;
this.title = toEdit.title; this.title = toEdit.title;
this.description = toEdit.description; this.description = toEdit.description;
@@ -105,7 +104,7 @@ export class AddNotebookDialog extends React.Component {
let edit = this.props.toEdit; let edit = this.props.toEdit;
if (edit && edit.id) { if (edit && edit.id) {
let topicToDelete = edit.topics[index + 1]; let topicToDelete = edit.topics[index + 1];
console.log(topicToDelete);
if (topicToDelete) { if (topicToDelete) {
this.topicsToDelete.push(topicToDelete.id); this.topicsToDelete.push(topicToDelete.id);
} }
@@ -432,7 +431,7 @@ export class AddNotebookDialog extends React.Component {
<TopicItem <TopicItem
item={item} item={item}
onPress={(item, index) => { onPress={(item, index) => {
console.log('here');
this.prevIndex = index; this.prevIndex = index;
this.prevItem = item; this.prevItem = item;
this.topicInputRef.setNativeProps({ this.topicInputRef.setNativeProps({

View File

@@ -66,10 +66,6 @@ export const ContainerBottomButton = ({title, onPress, color,shouldShow =false})
...getElevation(5), ...getElevation(5),
borderRadius: 100, borderRadius: 100,
}} }}
onLongPress={(event) => {
console.log(event);
showContext(event, title);
}}
onPress={onPress}> onPress={onPress}>
<View <View
style={{ style={{

View File

@@ -26,7 +26,7 @@ export const HeaderRightMenu = () => {
{DDS.isLargeTablet() && containerBottomButton.onPress ? ( {DDS.isLargeTablet() && containerBottomButton.onPress ? (
<Button <Button
onPress={ () => { onPress={ () => {
console.log('hello');
containerBottomButton.onPress() containerBottomButton.onPress()
}} }}

View File

@@ -109,7 +109,7 @@ const LoginDialog = () => {
try { try {
let res = await db.user.login(username.toLowerCase(), password); let res = await db.user.login(username.toLowerCase(), password);
console.log(res, username, password);
} catch (e) { } catch (e) {
setTimeout(() => { setTimeout(() => {
ToastEvent.show(e.message, 'error', 'local'); ToastEvent.show(e.message, 'error', 'local');
@@ -146,7 +146,7 @@ const LoginDialog = () => {
ToastEvent.show('Passwords do not match', 'error', 'local'); ToastEvent.show('Passwords do not match', 'error', 'local');
return false; return false;
} }
console.log(invalidEmail, invalidPassword, invalidUsername);
if (invalidEmail && invalidPassword && invalidUsername) { if (invalidEmail && invalidPassword && invalidUsername) {
ToastEvent.show('Signup information is invalid', 'error', 'local'); ToastEvent.show('Signup information is invalid', 'error', 'local');
return false; return false;

View File

@@ -38,9 +38,7 @@ export const TagsSection = () => {
eSendEvent(refreshNotesPage, params); eSendEvent(refreshNotesPage, params);
NavigationService.closeDrawer(); NavigationService.closeDrawer();
}; };
useEffect(() => {
console.log(currentScreen);
}, [currentScreen]);
return ( return (
<View <View
style={{ style={{

View File

@@ -33,10 +33,6 @@ export const Menu = React.memo(
dispatch({type: Actions.THEME, colors: newColors}); dispatch({type: Actions.THEME, colors: newColors});
} }
React.useEffect(() => {
console.log('rerendering drawer');
});
const BottomItemsList = [ const BottomItemsList = [
{ {
name: 'Night mode', name: 'Night mode',

View File

@@ -112,7 +112,7 @@ class RecoveryKeyDialog extends React.Component {
onOpen = async () => { onOpen = async () => {
let k = await db.user.key(); let k = await db.user.key();
this.user = await db.user.get(); this.user = await db.user.get();
console.log(k);
if (k) { if (k) {
this.setState({ this.setState({
key: k.key, key: k.key,

View File

@@ -61,7 +61,6 @@ const RestoreDialog = () => {
await db.backup.import(backup); await db.backup.import(backup);
await sleep(2000); await sleep(2000);
setRestoring(false); setRestoring(false);
console.log(db.notes.all);
dispatch({type: Actions.ALL}); dispatch({type: Actions.ALL});
ToastEvent.show('Restore Complete!', 'success'); ToastEvent.show('Restore Complete!', 'success');
setVisible(false); setVisible(false);
@@ -77,7 +76,7 @@ const RestoreDialog = () => {
} }
let path = await storage.checkAndCreateDir('/backups/'); let path = await storage.checkAndCreateDir('/backups/');
let files = await RNFetchBlob.fs.lstat(path); let files = await RNFetchBlob.fs.lstat(path);
console.log(files);
setFiles(files); setFiles(files);
}; };

View File

@@ -12,7 +12,6 @@ export const SearchInput = (props) => {
const updateSearchState = () => { const updateSearchState = () => {
setSearchState(SearchService.getSearchInformation().placeholder); setSearchState(SearchService.getSearchInformation().placeholder);
console.log(SearchService.getSearchInformation().placeholder);
}; };
useEffect(() => { useEffect(() => {

View File

@@ -25,25 +25,7 @@ export const ListHeaderComponent = ({
}) => { }) => {
const [state] = useTracked(); const [state] = useTracked();
const {colors, headerTextState, currentScreen} = state; const {colors, headerTextState, currentScreen} = state;
/*
const onScroll = async (y) => {
if (y > 100) {
let o = (y - 100) / 100;
o = 1 - o;
console.log(o);
opacity.setValue(o);
} else {
opacity.setValue(1);
}
};
useEffect(() => {
eSubscribeEvent(eScrollEvent, onScroll);
return () => {
eUnSubscribeEvent(eScrollEvent, onScroll);
};
}, []);
*/
return type === 'search' ? null : DDS.isLargeTablet() && !shouldShow ? ( return type === 'search' ? null : DDS.isLargeTablet() && !shouldShow ? (
<View <View
style={{ style={{

View File

@@ -86,7 +86,6 @@ const SimpleList = ({
}}> }}>
<Paragraph <Paragraph
onPress={() => { onPress={() => {
console.log('clicekd');
if (jumpToDialog) { if (jumpToDialog) {
eSendEvent(eOpenJumpToDialog); eSendEvent(eOpenJumpToDialog);
} }

View File

@@ -96,7 +96,7 @@ export const Toast = ({context = 'global'}) => {
easing: Easing.inOut(Easing.ease), easing: Easing.inOut(Easing.ease),
}).start(async () => { }).start(async () => {
await sleep(300); await sleep(300);
console.log(toastMessages);
toastMessages.shift(); toastMessages.shift();
setData({}); setData({});
}); });

View File

@@ -20,7 +20,7 @@ const Paragraph = ({color, size, style, ...restProps}) => {
return ( return (
<Text <Text
onLayout={e => console.log(e.nativeEvent.layout.height,"HEIGHT")}
{...restProps} {...restProps}
style={[ style={[
{ {

View File

@@ -249,7 +249,6 @@ export class VaultDialog extends Component {
} }
_permanantUnlock() { _permanantUnlock() {
console.log('permanant unlock');
db.vault db.vault
.remove(this.state.note.id, this.password) .remove(this.state.note.id, this.password)
.then((r) => { .then((r) => {
@@ -301,7 +300,6 @@ export class VaultDialog extends Component {
cancel: null, cancel: null,
}, },
}); });
console.log(credentials.password);
if (credentials?.password) { if (credentials?.password) {
this.password = credentials.password; this.password = credentials.password;
this.onPress(); this.onPress();

View File

@@ -67,9 +67,6 @@ export const NavigatorStack = React.memo(
const [state] = useTracked(); const [state] = useTracked();
const {settings} = state; const {settings} = state;
React.useEffect(() => {
console.log("rerendering navigator stack");
})
return ( return (
<Container root={true}> <Container root={true}>

View File

@@ -46,12 +46,10 @@ export class DeviceDetectionService {
this.width = Dimensions.get('screen').width; this.width = Dimensions.get('screen').width;
this.height = Dimensions.get('screen').height; this.height = Dimensions.get('screen').height;
let deviceSize = this.getDeviceSize(); let deviceSize = this.getDeviceSize();
console.log(orientation, 'orientation');
if ( if (
(!DeviceInfo.isTablet() && orientation === 'LANDSCAPE') || (!DeviceInfo.isTablet() && orientation === 'LANDSCAPE') ||
(DeviceInfo.isTablet() && (orientation === 'PORTRAIT' || deviceSize < 9)) (DeviceInfo.isTablet() && (orientation === 'PORTRAIT' || deviceSize < 9))
) { ) {
console.log('small tab');
this.isTab = true; this.isTab = true;
this.isPhone = false; this.isPhone = false;
this.isSmallTab = true; this.isSmallTab = true;

View File

@@ -13,7 +13,6 @@ let previousIntent = {
function check() { function check() {
ReceiveSharingIntent.getReceivedFiles( ReceiveSharingIntent.getReceivedFiles(
(d) => { (d) => {
console.log('INTENT SERVICE', d);
let data = d[0]; let data = d[0];
if (data.text || data.weblink) { if (data.text || data.weblink) {
let text = data.text; let text = data.text;

View File

@@ -19,7 +19,7 @@ export const getDeviceSize = () => {
}; };
const getDpi = (pd) => { const getDpi = (pd) => {
console.log(pd);
return 160 * pd; return 160 * pd;
}; };
const correction = (size, multiplier) => { const correction = (size, multiplier) => {
@@ -38,10 +38,9 @@ const correction = (size, multiplier) => {
} else if (dSize > 7.2 && dSize <= 8.5 && DDS.isTab) { } else if (dSize > 7.2 && dSize <= 8.5 && DDS.isTab) {
return size * 0.9; return size * 0.9;
} else if (dSize > 8.5 && dSize <= 9.8 && DDS.isTab) { } else if (dSize > 8.5 && dSize <= 9.8 && DDS.isTab) {
console.log(dSize)
return size * 0.8; return size * 0.8;
} else if (dSize > 9.8) { } else if (dSize > 9.8) {
console.log("HERE CALC",dSize)
return size * 0.85; return size * 0.85;
} else { } else {
return size; return size;

View File

@@ -46,7 +46,7 @@ export async function deleteItems(item) {
let it = itemsCopy[i]; let it = itemsCopy[i];
let trashItem = trash.all.find((item) => item.itemId === it.id); let trashItem = trash.all.find((item) => item.itemId === it.id);
await db.trash.restore(trashItem.id); await db.trash.restore(trashItem.id);
console.log(it.type, 'type'); s
updateEvent({type: it.type}); updateEvent({type: it.type});
} }
updateEvent({type: Actions.TRASH}); updateEvent({type: Actions.TRASH});

View File

@@ -64,7 +64,7 @@ export const history = {
}; };
export async function showContext(event, title) { export async function showContext(event, title) {
console.log(event.nativeEvent);
event._targetInst.ref.current?.measureInWindow((x, y, w, h) => { event._targetInst.ref.current?.measureInWindow((x, y, w, h) => {
dummyRef.current.setNativeProps({ dummyRef.current.setNativeProps({
style: { style: {

View File

@@ -78,7 +78,7 @@ const EditorHeader = () => {
}, [fullscreen]); }, [fullscreen]);
const load = async (item) => { const load = async (item) => {
console.log(item);
await loadNote(item); await loadNote(item);
Keyboard.addListener('keyboardDidShow', () => { Keyboard.addListener('keyboardDidShow', () => {
post('keyboard'); post('keyboard');

View File

@@ -138,7 +138,6 @@ async function setNote(item) {
} }
function clearNote() { function clearNote() {
console.log('note cleared');
note = null; note = null;
title = ''; title = '';
noteEdited = false; noteEdited = false;
@@ -152,7 +151,7 @@ function clearNote() {
let currentEditingTimer = null; let currentEditingTimer = null;
export async function loadNote(item) { export async function loadNote(item) {
console.log(item);
editing.currentlyEditing = true; editing.currentlyEditing = true;
post('blur'); post('blur');
if (item && item.type === 'new') { if (item && item.type === 'new') {

View File

@@ -77,7 +77,6 @@ export const Home = ({navigation}) => {
if (!DDS.isLargeTablet()) { if (!DDS.isLargeTablet()) {
tabBarRef.current?.goToPage(1); tabBarRef.current?.goToPage(1);
} else { } else {
console.log('called');
eSendEvent(eOnLoadNote, {type: 'new'}); eSendEvent(eOnLoadNote, {type: 'new'});
} }
}; };

View File

@@ -33,7 +33,6 @@ export const Notes = ({route, navigation}) => {
}, []); }, []);
const init = (data) => { const init = (data) => {
console.log('rerendering');
params = route.params; params = route.params;
if (data) { if (data) {
params = data; params = data;

View File

@@ -119,11 +119,10 @@ export const Settings = ({navigation}) => {
const checkVaultStatus = useCallback(() => { const checkVaultStatus = useCallback(() => {
db.vault.add('check_no_vault').catch(async (e) => { db.vault.add('check_no_vault').catch(async (e) => {
console.log(e);
let biometry = await Keychain.getSupportedBiometryType(); let biometry = await Keychain.getSupportedBiometryType();
let fingerprint = await Keychain.hasInternetCredentials('nn_vault'); let fingerprint = await Keychain.hasInternetCredentials('nn_vault');
console.log(biometry, fingerprint, 'val');
let available = false; let available = false;
if ( if (
biometry === Keychain.BIOMETRY_TYPE.FINGERPRINT || biometry === Keychain.BIOMETRY_TYPE.FINGERPRINT ||