Two fixes for tricky import/register scenarios (#2072)
* Clear data on finish of new install, unless re-link/light import * Don't show setup options in file menu in middle of light import * Naming changes to address feedback
This commit is contained in:
parent
ae75390acc
commit
2a384cef7e
2 changed files with 34 additions and 8 deletions
|
@ -32,9 +32,8 @@
|
|||
this.connect();
|
||||
this.on('disconnected', this.reconnect);
|
||||
|
||||
if (Whisper.Registration.everDone() || options.startStep) {
|
||||
this.selectStep(options.startStep || Steps.SCAN_QR_CODE);
|
||||
}
|
||||
// Keep data around if it's a re-link, or the middle of a light import
|
||||
this.shouldRetainData = Whisper.Registration.everDone() || options.hasExistingData;
|
||||
},
|
||||
render_attributes: function() {
|
||||
var errorMessage;
|
||||
|
@ -162,11 +161,29 @@
|
|||
}
|
||||
|
||||
this.selectStep(Steps.PROGRESS_BAR);
|
||||
resolve(name);
|
||||
|
||||
var finish = function() {
|
||||
resolve(name);
|
||||
};
|
||||
|
||||
// Delete all data from database unless we're in the middle
|
||||
// of a re-link, or we are finishing a light import. Without this,
|
||||
// app restarts at certain times can cause weird things to happen,
|
||||
// like data from a previous incomplete light import showing up
|
||||
// after a new install.
|
||||
if (this.shouldRetainData) {
|
||||
return finish();
|
||||
}
|
||||
|
||||
Whisper.Backup.clearDatabase().then(finish, function(error) {
|
||||
console.log(
|
||||
'confirmNumber: error clearing database',
|
||||
error && error.stack ? error.stack : error
|
||||
);
|
||||
finish();
|
||||
});
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
},
|
||||
});
|
||||
|
||||
Whisper.InstallView.Steps = Steps;
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue