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) => {
if (state === 'active') {
console.log('active state');
StatusBar.setBarStyle(
COLOR_SCHEME.night ? 'light-content' : 'dark-content',
true,
@@ -164,7 +163,6 @@ const App = () => {
(async () => {
try {
await db.init();
console.log('db is initialized');
} catch (e) {
error = e;
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');
const onChangeTab = async (obj) => {
console.log('tab changed');
if (obj.i === 1) {
eSendEvent(eCloseSideMenu);
if (getIntent()) return;

View File

@@ -513,7 +513,7 @@ function fixDropdownMenuLocations() {
document.getElementById(dropdown).style.top = downTop + 20;
document.getElementById(dropdown).style.left = left;
//console.log('called',downTop + 20,left);
});
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -25,25 +25,7 @@ export const ListHeaderComponent = ({
}) => {
const [state] = useTracked();
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 ? (
<View
style={{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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