Move initial key backup to background
Since the initial key backup can take several minutes for some users, this moves the upload step to the background. The create key backup flow now only marks all sessions for backup synchronously, with the actual backup happening later. The key backup panel in Settings gains a new row to show a summary of upload status. Users are directed there if they wish to know if the backup is done. The text in various related dialogs has also been tweaked to fit the new flow.
This commit is contained in:
parent
731f9ee7df
commit
365a7273d8
3 changed files with 28 additions and 20 deletions
|
@ -21,7 +21,7 @@ import { scorePassword } from '../../../../utils/PasswordScorer';
|
|||
|
||||
import FileSaver from 'file-saver';
|
||||
|
||||
import { _t, _td } from '../../../../languageHandler';
|
||||
import { _t } from '../../../../languageHandler';
|
||||
|
||||
const PHASE_PASSPHRASE = 0;
|
||||
const PHASE_PASSPHRASE_CONFIRM = 1;
|
||||
|
@ -102,7 +102,7 @@ export default React.createClass({
|
|||
info = await MatrixClientPeg.get().createKeyBackupVersion(
|
||||
this._keyBackupInfo,
|
||||
);
|
||||
await MatrixClientPeg.get().backupAllGroupSessions(info.version);
|
||||
await MatrixClientPeg.get().scheduleAllGroupSessionsForBackup();
|
||||
this.setState({
|
||||
phase: PHASE_DONE,
|
||||
});
|
||||
|
@ -408,7 +408,6 @@ export default React.createClass({
|
|||
_renderBusyPhase: function(text) {
|
||||
const Spinner = sdk.getComponent('views.elements.Spinner');
|
||||
return <div>
|
||||
<p>{_t(text)}</p>
|
||||
<Spinner />
|
||||
</div>;
|
||||
},
|
||||
|
@ -416,8 +415,10 @@ export default React.createClass({
|
|||
_renderPhaseDone: function() {
|
||||
const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
|
||||
return <div>
|
||||
<p>{_t("Backup created")}</p>
|
||||
<p>{_t("Your encryption keys are now being backed up to your Homeserver.")}</p>
|
||||
<p>{_t(
|
||||
"Your encryption keys are now being backed up in the background " +
|
||||
"to your Homeserver. The initial backup could take several minutes. " +
|
||||
"You can view key backup upload progress in Settings.")}</p>
|
||||
<DialogButtons primaryButton={_t('Close')}
|
||||
onPrimaryButtonClick={this._onDone}
|
||||
hasCancel={false}
|
||||
|
@ -454,7 +455,9 @@ export default React.createClass({
|
|||
case PHASE_KEEPITSAFE:
|
||||
return _t('Keep it safe');
|
||||
case PHASE_BACKINGUP:
|
||||
return _t('Backing up...');
|
||||
return _t('Starting backup...');
|
||||
case PHASE_DONE:
|
||||
return _t('Backup Started');
|
||||
default:
|
||||
return _t("Create Key Backup");
|
||||
}
|
||||
|
@ -491,7 +494,7 @@ export default React.createClass({
|
|||
content = this._renderPhaseKeepItSafe();
|
||||
break;
|
||||
case PHASE_BACKINGUP:
|
||||
content = this._renderBusyPhase(_td("Backing up..."));
|
||||
content = this._renderBusyPhase();
|
||||
break;
|
||||
case PHASE_DONE:
|
||||
content = this._renderPhaseDone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue