Skip to content

Commit

Permalink
Installed latest controller with validate_pem fixes. Added translatio…
Browse files Browse the repository at this point in the history
…n for validate pem messages. Made error toast generic (#653)

Co-authored-by: rocky-fleek <[email protected]>
  • Loading branch information
tomiir and rocky-fleek authored Oct 25, 2022
1 parent a5dfcca commit 02fccdc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@metamask/post-message-stream": "^4.0.0",
"@psychedelic/browser-rpc": "2.1.0",
"@psychedelic/dab-js": "1.5.0-beta.1",
"@psychedelic/plug-controller": "0.24.3",
"@psychedelic/plug-controller": "0.24.4",
"@psychedelic/plug-inpage-provider": "^2.3.1",
"@reduxjs/toolkit": "^1.6.0",
"advanced-css-reset": "^1.2.2",
Expand Down
4 changes: 4 additions & 0 deletions source/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"copyTextAddress": "Copy address to clipboard",
"copiedText": "Copied!"
},
"importPEM": {
"added-account": "Account already added",
"invalid-key": "Invalid PEM file"
},
"profile": {
"myAccounts": "My Accounts",
"createAccount": "Create Account",
Expand Down
10 changes: 6 additions & 4 deletions source/views/Extension/Views/ImportWallet/hooks/useSteps.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ const useSteps = () => {
sendMessage({
type: HANDLER_TYPES.VALIDATE_PEM,
params: { pem: content },
}, (validPem) => {
if (!validPem) {
toast('Invalid PEM file', { type: 'error' });
}, (response) => {
const { isValid, errorType } = response;
if (!isValid) {
toast(t(`importPEM.${errorType}`), { type: 'error' });
setUserPemFile(null);
}
setValidateLoading(false);
setImportDisabled(!validPem);
setImportDisabled(!isValid);
});
};
}, [userPemFile]);
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1787,10 +1787,10 @@
cross-fetch "^3.1.4"
crypto-js "^4.1.1"

"@psychedelic/[email protected].3":
version "0.24.3"
resolved "https://npm.pkg.github.com/download/@Psychedelic/plug-controller/0.24.3/f150066563e837bde728b059e061dd8abdb02bfc#f150066563e837bde728b059e061dd8abdb02bfc"
integrity sha512-amRsv2TFVeTwVzIh36izVxiLK+/jqudxMtZrCOEFkKjZ+LVgJ5Slt/6kc/VWUDxuzlPfJfpmN0ZytwxTE66zDw==
"@psychedelic/[email protected].4":
version "0.24.4"
resolved "https://npm.pkg.github.com/download/@Psychedelic/plug-controller/0.24.4/7c71cf00d570b5792fb43513b13cf156f4d05ce6#7c71cf00d570b5792fb43513b13cf156f4d05ce6"
integrity sha512-iYXhvsGgRLExLt9J58QJ2xU2YVFobvB+2HI4WZ5KcbPvzGeDZsMsjUSTnNXiqXVn3wzjtzp0ks+gG2K/DslTdw==
dependencies:
"@dfinity/agent" "0.9.3"
"@dfinity/candid" "0.9.3"
Expand Down

0 comments on commit 02fccdc

Please sign in to comment.