1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Simplified sync logging and reporting

This commit is contained in:
Laurent Cozic
2017-07-14 19:06:01 +00:00
parent 18b5453146
commit f840dd505f
4 changed files with 44 additions and 79 deletions

View File

@@ -53,20 +53,16 @@ class SideMenuContentComponent extends Component {
async synchronize_press() {
if (reg.oneDriveApi().auth()) {
const sync = await reg.synchronizer()
let options = {
onProgress: (report) => {
let line = [];
line.push(_('Items to upload: %d/%d.', report.createRemote + report.updateRemote, report.remotesToUpdate));
line.push(_('Remote items to delete: %d/%d.', report.deleteRemote, report.remotesToDelete));
line.push(_('Items to download: %d/%d.', report.createLocal + report.updateLocal, report.localsToUdpate));
line.push(_('Local items to delete: %d/%d.', report.deleteLocal, report.localsToDelete));
line.push(_('Sync state: %s.', report.state));
this.setState({ syncReportText: line.join("\n") });
let lines = sync.reportToLines(report);
this.setState({ syncReportText: lines.join("\n") });
},
};
try {
const sync = await reg.synchronizer()
sync.start(options);
} catch (error) {
Log.error(error);