mirror of https://github.com/status-im/js-waku.git
Add check in case user tries with incompatible wallet
This commit is contained in:
parent
1e69811d8d
commit
3b32987ecf
|
@ -23,9 +23,14 @@ export default function GetEncryptionPublicKey({
|
||||||
method: 'eth_getEncryptionPublicKey',
|
method: 'eth_getEncryptionPublicKey',
|
||||||
params: [address],
|
params: [address],
|
||||||
})
|
})
|
||||||
.then((key: string) => {
|
.then((key: string | undefined) => {
|
||||||
console.log('Encryption Public key:', key);
|
console.log('Encryption Public key:', key);
|
||||||
|
|
||||||
|
if (typeof key !== 'string') {
|
||||||
|
console.error('Could not get encryption key');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setEncPublicKey(Buffer.from(key, 'base64'));
|
setEncPublicKey(Buffer.from(key, 'base64'));
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|
Loading…
Reference in New Issue