|
|
@ -380,7 +380,7 @@ export default class MetamaskController extends EventEmitter { |
|
|
|
this.keyringController.memStore.subscribe((state) => |
|
|
|
this.keyringController.memStore.subscribe((state) => |
|
|
|
this._onKeyringControllerUpdate(state), |
|
|
|
this._onKeyringControllerUpdate(state), |
|
|
|
); |
|
|
|
); |
|
|
|
this.keyringController.on('unlock', () => this.emit('unlock')); |
|
|
|
this.keyringController.on('unlock', () => this._onUnlock()); |
|
|
|
this.keyringController.on('lock', () => this._onLock()); |
|
|
|
this.keyringController.on('lock', () => this._onLock()); |
|
|
|
|
|
|
|
|
|
|
|
this.permissionsController = new PermissionsController( |
|
|
|
this.permissionsController = new PermissionsController( |
|
|
@ -2626,10 +2626,10 @@ export default class MetamaskController extends EventEmitter { |
|
|
|
? (origin) => payload(origin) |
|
|
|
? (origin) => payload(origin) |
|
|
|
: () => payload; |
|
|
|
: () => payload; |
|
|
|
|
|
|
|
|
|
|
|
Object.values(this.connections).forEach((origin) => { |
|
|
|
Object.keys(this.connections).forEach((origin) => { |
|
|
|
Object.values(origin).forEach((conn) => { |
|
|
|
Object.values(this.connections[origin]).forEach(async (conn) => { |
|
|
|
if (conn.engine) { |
|
|
|
if (conn.engine) { |
|
|
|
conn.engine.emit('notification', getPayload(origin)); |
|
|
|
conn.engine.emit('notification', await getPayload(origin)); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -2664,12 +2664,12 @@ export default class MetamaskController extends EventEmitter { |
|
|
|
* Notifies all connections that the extension is unlocked. |
|
|
|
* Notifies all connections that the extension is unlocked. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
_onUnlock() { |
|
|
|
_onUnlock() { |
|
|
|
this.notifyAllConnections((origin) => { |
|
|
|
this.notifyAllConnections(async (origin) => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
method: NOTIFICATION_NAMES.unlockStateChanged, |
|
|
|
method: NOTIFICATION_NAMES.unlockStateChanged, |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
isUnlocked: true, |
|
|
|
isUnlocked: true, |
|
|
|
accounts: this.permissionsController.getAccounts(origin), |
|
|
|
accounts: await this.permissionsController.getAccounts(origin), |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}); |
|
|
|
}); |
|
|
|