import React from 'react'; import { View, Button, Alert, Text } from 'react-native'; // Redux import { connect } from 'react-redux'; import { initDocuments } from '../Store/Actions/documents'; // Style import styles from '../../Resources/Styles/SyncStyle'; // Translations import i18n from "../../I18n"; // Controller import SyncController from '../Controllers/SyncController'; // Progress import * as Progress from 'react-native-progress'; // Database import { User, Contact, Directory, Document } from '../../Database'; // FileSytem import * as FileSystem from 'expo-file-system'; function mapStateToProps(state) { return { documents: state.app.documents, syncVersion: state.app.syncVersion, currentUser: state.app.currentUser, directories: state.app.directories, locale: state.locale.locale, }; } const mapDispatchToProps = dispatch => { return { init: (locale, directories) => { dispatch({ type: 'INIT' }) dispatch(initDocuments(locale, directories)) }, updateVersion: version => dispatch({ type: 'UPDATE_VERSION', data: version, }), updateShowIsActive: value => dispatch({ type: 'UPDATE_SHOW_IS_ACTIVE', data: value, }) }; }; class SyncScreen extends React.Component { state = { progress: 0, txtStep: '', downloadProgress: 0, downloadingFile: false, processing: false, newApp: false }; componentDidMount() { const { forceSync } = this.props.route.params; if (forceSync === true) { this.sync(); } } render() { const fileProgress = this.fileProgress(); return (