Skip to content

Commit

Permalink
fix save code
Browse files Browse the repository at this point in the history
  • Loading branch information
freepoi committed Nov 26, 2021
1 parent 1f8e308 commit 0b224a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "europa-ui",
"version": "0.3.34",
"version": "0.3.35",
"main": "main.js",
"private": true,
"description": "An UI used for deploying and testing contracts on the Europa node embedded",
Expand Down
11 changes: 4 additions & 7 deletions src/pages/contract/DeployModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,7 @@ export const DeployModal: FC<{
Alive: { codeHash },
} = info;

if (
!store.getCode(codeHash) &&
codeJSON &&
codeJSON.abi &&
wasm
) {
if (!store.getCode(codeHash) && codeJSON && codeJSON.abi) {
const abi: {
source: {
_alias: {
Expand All @@ -333,7 +328,9 @@ export const DeployModal: FC<{
};
} = JSON.parse(codeJSON.abi!);

abi.source.wasm = u8aToHex(wasm);
if (wasm) {
abi.source.wasm = u8aToHex(wasm);
}
store.saveCode(codeHash, {
...codeJSON!,
abi: JSON.stringify(abi),
Expand Down

0 comments on commit 0b224a7

Please sign in to comment.