Change and fix console log and debugs (changes all simple console.log)
This commit is contained in:
parent
918e20a72b
commit
b52795e588
10 changed files with 29 additions and 29 deletions
|
|
@ -50,7 +50,7 @@ class InstallController {
|
|||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
console.error(error);
|
||||
Alert.alert(
|
||||
i18n.t('alert.error'),
|
||||
i18n.t('error.error_has_occurred'),
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class SendBrochureModel {
|
|||
try {
|
||||
this.realm.create(this.schema, data, 'never');
|
||||
} catch (e) {
|
||||
console.log('db setting add', e);
|
||||
console.error('db setting add', e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class SettingModel {
|
|||
try {
|
||||
this.realm.create(this.schema, data, 'never');
|
||||
} catch (e) {
|
||||
console.log('db setting add', e);
|
||||
console.error('db setting add', e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class UserModel {
|
|||
try {
|
||||
this.realm.create(this.schema, data, 'never');
|
||||
} catch (e) {
|
||||
console.log('db setting add', e);
|
||||
console.error('db setting add', e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ class ContactDetailsScreen extends React.Component {
|
|||
contact.data = Form.getAll(InputStatus.DEFAULT).map(
|
||||
this.initField.bind(this),
|
||||
);
|
||||
console.log(contact.data);
|
||||
console.debug(contact.data);
|
||||
contact.data.map(input => {
|
||||
const originalInput = originalData.get(input.formSlug);
|
||||
// * Had this input before ?
|
||||
|
|
@ -342,7 +342,7 @@ class ContactDetailsScreen extends React.Component {
|
|||
[
|
||||
{
|
||||
text: i18n.t('global.no'),
|
||||
onPress: () => console.log('Cancel Pressed'),
|
||||
onPress: () => console.debug('Cancel Pressed'),
|
||||
style: 'cancel',
|
||||
},
|
||||
{
|
||||
|
|
@ -1460,8 +1460,8 @@ class ContactDetailsScreen extends React.Component {
|
|||
const dataIndex = contact.data.findIndex(
|
||||
input => input.formSlug === slug,
|
||||
);
|
||||
console.log(dataIndex);
|
||||
console.log(contact.data);
|
||||
console.debug(dataIndex);
|
||||
console.debug(contact.data);
|
||||
// * Set value on data.
|
||||
contact.data[dataIndex].value = details[itemIndex] ?? undefined;
|
||||
console.debug(contact.data[dataIndex]);
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ class ContactScreen extends React.Component {
|
|||
[
|
||||
{
|
||||
text: i18n.t('global.no'),
|
||||
onPress: () => console.log('Cancel Pressed'),
|
||||
onPress: () => console.debug('Cancel Pressed'),
|
||||
style: 'cancel',
|
||||
},
|
||||
{
|
||||
|
|
@ -206,7 +206,7 @@ class ContactScreen extends React.Component {
|
|||
return Linking.openURL(phoneNumber);
|
||||
}
|
||||
})
|
||||
.catch(err => console.log(err));
|
||||
.catch(err => console.error(err));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import {Image, ScrollView, Text, TouchableOpacity, View} from 'react-native';
|
||||
import { Image, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
||||
// Redux
|
||||
import {connect} from 'react-redux';
|
||||
import { connect } from 'react-redux';
|
||||
// Treeview
|
||||
import TreeView from 'react-native-animated-tree-view';
|
||||
// Icon
|
||||
|
|
@ -26,12 +26,12 @@ class DirectoriesScreen extends React.Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const {folder} = this.props.route.params;
|
||||
const { folder } = this.props.route.params;
|
||||
let documentList = this.state.documents.map(document => {
|
||||
return (
|
||||
<TouchableOpacity
|
||||
key={document.id.toString()}
|
||||
style={{...styles.file, backgroundColor: this.props.mainColor}}
|
||||
style={{ ...styles.file, backgroundColor: this.props.mainColor }}
|
||||
onPress={() => this.openDocument(document)}>
|
||||
{document.type === 'pdf' ? (
|
||||
<FontAwesome5 name="file-pdf" color={'white'} size={60} />
|
||||
|
|
@ -46,11 +46,11 @@ class DirectoriesScreen extends React.Component {
|
|||
return (
|
||||
<View style={styles.container}>
|
||||
<View
|
||||
style={{width: 290, borderRightWidth: 1, borderColor: 'lightgrey'}}>
|
||||
style={{ width: 290, borderRightWidth: 1, borderColor: 'lightgrey' }}>
|
||||
<TreeView
|
||||
data={folder}
|
||||
leftImage={{}}
|
||||
rightImage={{uri: Image.resolveAssetSource(arrowDown).uri}}
|
||||
rightImage={{ uri: Image.resolveAssetSource(arrowDown).uri }}
|
||||
containerStyle={styles.treeviewContainer}
|
||||
onClick={folder => {
|
||||
this.setState({
|
||||
|
|
@ -69,13 +69,13 @@ class DirectoriesScreen extends React.Component {
|
|||
}
|
||||
|
||||
openDocument(document) {
|
||||
this.props.dispatch({type: 'SET_CURRENT_OPENED_DOC', data: document});
|
||||
this.props.dispatch({ type: 'SET_CURRENT_OPENED_DOC', data: document });
|
||||
if (document.type === 'pdf') {
|
||||
this.props.navigation.navigate('PDFScreen', {uuid: document.uuid});
|
||||
this.props.navigation.navigate('PDFScreen', { uuid: document.uuid });
|
||||
} else if (document.type === 'mp4') {
|
||||
this.props.navigation.navigate('VideoScreen', {uuid: document.uuid});
|
||||
this.props.navigation.navigate('VideoScreen', { uuid: document.uuid });
|
||||
} else {
|
||||
console.log('Inconnu');
|
||||
console.warn('Type de document Inconnu');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,11 +112,11 @@ class InstallScreen extends React.Component {
|
|||
Setting.upsert({ key: 'bo_url', value: url });
|
||||
const isConnected = await SyncController.checkConnection()
|
||||
.then(state => {
|
||||
//console.log(state.isConnected)
|
||||
console.debug(state.isConnected);
|
||||
return state.isConnected;
|
||||
})
|
||||
.catch(error => {
|
||||
//console.log(error);
|
||||
console.error(error);
|
||||
return false;
|
||||
});
|
||||
if (!isConnected) {
|
||||
|
|
@ -174,7 +174,7 @@ class InstallScreen extends React.Component {
|
|||
for await (const file of toDL) {
|
||||
await FileSystem.downloadAsync(file.source, file.dest)
|
||||
.then(({ uri }) => {
|
||||
console.log('Finished downloading to ', uri);
|
||||
console.debug('Finished downloading to ', uri);
|
||||
})
|
||||
.catch(error => {
|
||||
Alert.alert(
|
||||
|
|
@ -196,7 +196,7 @@ class InstallScreen extends React.Component {
|
|||
return res.data;
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
console.error(error);
|
||||
Alert.alert(
|
||||
i18n.t('error.error'),
|
||||
i18n.t('error.error_has_occurred'),
|
||||
|
|
|
|||
|
|
@ -19,16 +19,16 @@ class PDFScreen extends React.Component {
|
|||
<Pdf
|
||||
source={source}
|
||||
onLoadComplete={(numberOfPages, filePath) => {
|
||||
//console.log(`number of pages: ${numberOfPages}`);
|
||||
console.debug(`number of pages: ${numberOfPages}`);
|
||||
}}
|
||||
onPageChanged={(page, numberOfPages) => {
|
||||
//console.log(`current page: ${page}`);
|
||||
console.debug(`current page: ${page}`);
|
||||
}}
|
||||
onError={error => {
|
||||
console.log(error);
|
||||
console.error(error);
|
||||
}}
|
||||
onPressLink={uri => {
|
||||
//console.log(`Link presse: ${uri}`);
|
||||
console.debug(`Link presse: ${uri}`);
|
||||
}}
|
||||
style={styles.pdf}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class SearchScreen extends React.Component {
|
|||
} else if (document.type === 'mp4') {
|
||||
this.props.navigation.navigate('VideoScreen', { uuid: document.uuid });
|
||||
} else {
|
||||
console.log('Inconnu');
|
||||
console.debug('Type de document inconnu');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue