Remove dead special-casing for OLM.BAD_LEGACY_ACCOUNT_PICKLE

We used to show a special error message when we got this error; however
https://github.com/matrix-org/matrix-react-sdk/pull/783 made that not work.

You'll only hit it if you're upgrading from some ancient version of Olm, and
I'm quite happy for us to fall back to the generic 'couldn't restore: vape your
storage?' flow in that case. (In any case that's preferable to dumping you at
the login prompt with no warning that we've just vaped your storage).
This commit is contained in:
Richard van der Hoff 2017-06-21 21:49:41 +01:00
parent 72e73c05ac
commit efc5cf2889
10 changed files with 1 additions and 26 deletions

View file

@ -29,7 +29,6 @@ import DMRoomMap from './utils/DMRoomMap';
import RtsClient from './RtsClient';
import Modal from './Modal';
import sdk from './index';
import { _t } from './languageHandler';
/**
* Called at startup, to attempt to build a logged-in Matrix session. It tries
@ -237,27 +236,12 @@ function _restoreFromLocalStorage() {
function _handleRestoreFailure(e) {
console.log("Unable to restore session", e);
let msg = e.message;
if (msg == "OLM.BAD_LEGACY_ACCOUNT_PICKLE") {
msg = _t(
'You need to log back in to generate end-to-end encryption keys'
+ ' for this device and submit the public key to your homeserver.'
+ ' This is a once off; sorry for the inconvenience.',
);
_clearStorage();
return q.reject(new Error(
_t('Unable to restore previous session') + ': ' + msg,
));
}
const def = q.defer();
const SessionRestoreErrorDialog =
sdk.getComponent('views.dialogs.SessionRestoreErrorDialog');
Modal.createDialog(SessionRestoreErrorDialog, {
error: msg,
error: e.message,
onFinished: (success) => {
def.resolve(success);
},