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

Mobile: Display decryption progress in side bar

This commit is contained in:
Laurent Cozic
2018-06-10 17:43:24 +01:00
parent 423d880b92
commit f6ee5dd0e7
3 changed files with 47 additions and 9 deletions

View File

@@ -218,12 +218,23 @@ class SideMenuContentComponent extends Component {
}
let lines = Synchronizer.reportToLines(this.props.syncReport);
while (lines.length < 10) lines.push(''); // Add blank lines so that height of report text is fixed and doesn't affect scrolling
const syncReportText = lines.join("\n");
let decryptionReportText = '';
if (this.props.decryptionWorker && this.props.decryptionWorker.state !== 'idle' && this.props.decryptionWorker.itemCount) {
decryptionReportText = _('Decrypting items: %d/%d', this.props.decryptionWorker.itemIndex + 1, this.props.decryptionWorker.itemCount);
}
let fullReport = [];
if (syncReportText) fullReport.push(syncReportText);
if (fullReport.length) fullReport.push('');
if (decryptionReportText) fullReport.push(decryptionReportText);
while (fullReport.length < 12) fullReport.push(''); // Add blank lines so that height of report text is fixed and doesn't affect scrolling
items.push(this.synchronizeButton(this.props.syncStarted ? 'cancel' : 'sync'));
items.push(<Text key='sync_report' style={this.styles().syncStatus}>{syncReportText}</Text>);
items.push(<Text key='sync_report' style={this.styles().syncStatus}>{fullReport.join('\n')}</Text>);
items.push(<View style={{ height: globalStyle.marginBottom }} key='bottom_padding_hack'/>);
@@ -260,6 +271,7 @@ const SideMenuContent = connect(
theme: state.settings.theme,
opacity: state.sideMenuOpenPercent,
collapsedFolderIds: state.collapsedFolderIds,
decryptionWorker: state.decryptionWorker,
};
}
)(SideMenuContentComponent)