Add check in case user tries with incompatible wallet

This commit is contained in:
Franck Royer 2021-08-12 16:01:49 +10:00
parent 1e69811d8d
commit 3b32987ecf
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 6 additions and 1 deletions

View File

@ -23,9 +23,14 @@ export default function GetEncryptionPublicKey({
method: 'eth_getEncryptionPublicKey',
params: [address],
})
.then((key: string) => {
.then((key: string | undefined) => {
console.log('Encryption Public key:', key);
if (typeof key !== 'string') {
console.error('Could not get encryption key');
return;
}
setEncPublicKey(Buffer.from(key, 'base64'));
})
.catch((error) => {