You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Ask for the user's password to rehydrate their soft logged out session
Fixes https://github.com/vector-im/riot-web/issues/10236 The changes to the MatrixClientPeg (assign/start) are to permit the SoftLogout page to access the MatrixClientPeg reliably. This is why assign() is called by Lifecycle as an alternative to start(). Minimal design work has been done here. The majority is deferred to https://github.com/vector-im/riot-web/issues/10262
This commit is contained in:
@@ -120,7 +120,7 @@ class MatrixClientPeg {
|
||||
this._createClient(creds);
|
||||
}
|
||||
|
||||
async start() {
|
||||
async assign() {
|
||||
for (const dbType of ['indexeddb', 'memory']) {
|
||||
try {
|
||||
const promise = this.matrixClient.store.startup();
|
||||
@@ -131,7 +131,7 @@ class MatrixClientPeg {
|
||||
if (dbType === 'indexeddb') {
|
||||
console.error('Error starting matrixclient store - falling back to memory store', err);
|
||||
this.matrixClient.store = new Matrix.MemoryStore({
|
||||
localStorage: global.localStorage,
|
||||
localStorage: global.localStorage,
|
||||
});
|
||||
} else {
|
||||
console.error('Failed to start memory store!', err);
|
||||
@@ -172,6 +172,12 @@ class MatrixClientPeg {
|
||||
MatrixActionCreators.start(this.matrixClient);
|
||||
MatrixClientBackedSettingsHandler.matrixClient = this.matrixClient;
|
||||
|
||||
return opts;
|
||||
}
|
||||
|
||||
async start() {
|
||||
const opts = await this.assign();
|
||||
|
||||
console.log(`MatrixClientPeg: really starting MatrixClient`);
|
||||
await this.get().startClient(opts);
|
||||
console.log(`MatrixClientPeg: MatrixClient started`);
|
||||
|
||||
Reference in New Issue
Block a user