Skip to content

Commit

Permalink
Temporarily disables state rehydration
Browse files Browse the repository at this point in the history
Unless MetaMask caches state at lock time, this actually slows down
the initialization process...
MetaMask/KeyringController#130
  • Loading branch information
alex-miller-0 committed Mar 19, 2022
1 parent a2646e9 commit 6c94bbe
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,23 +598,24 @@ class LatticeKeyring extends EventEmitter {
let url = 'https://signing.gridpl.us';
if (this.creds.endpoint)
url = this.creds.endpoint
let setupData;
let setupData = {
name: this.appName,
baseUrl: url,
timeout: SDK_TIMEOUT,
privKey: this._genSessionKey(),
network: this.network,
};
/*
NOTE: We need state to actually be synced by MetaMask or we can't
use this. See: https://github.com/MetaMask/KeyringController/issues/130
if (this.sdkState) {
// If we have state data we can fully rehydrate the session.
setupData = {
stateData: this.sdkState
}
} else {
// If we have no state data, we need to create a session.
// Its state will be saved once the connection is established.
setupData = {
name: this.appName,
baseUrl: url,
timeout: SDK_TIMEOUT,
privKey: this._genSessionKey(),
network: this.network,
}
}
*/
this.sdkSession = new SDK.Client(setupData);
// Return a boolean indicating whether we provided state data.
// If we have, we can skip `connect`.
Expand Down

0 comments on commit 6c94bbe

Please sign in to comment.