aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Millman <brandon@0xproject.com>2018-10-23 04:49:52 +0800
committerGitHub <noreply@github.com>2018-10-23 04:49:52 +0800
commit19f9649e74f487714f7094e013480f7b8e81090c (patch)
treea7efd6359332063412dd6cb919640d6bb3ec057a
parent2c308c0f4c172293e634d27f731d026e0361e639 (diff)
parent1a3b1607b12cd75a1fc12ecd504dad61bef8d291 (diff)
downloaddexon-sol-tools-19f9649e74f487714f7094e013480f7b8e81090c.tar
dexon-sol-tools-19f9649e74f487714f7094e013480f7b8e81090c.tar.gz
dexon-sol-tools-19f9649e74f487714f7094e013480f7b8e81090c.tar.bz2
dexon-sol-tools-19f9649e74f487714f7094e013480f7b8e81090c.tar.lz
dexon-sol-tools-19f9649e74f487714f7094e013480f7b8e81090c.tar.xz
dexon-sol-tools-19f9649e74f487714f7094e013480f7b8e81090c.tar.zst
dexon-sol-tools-19f9649e74f487714f7094e013480f7b8e81090c.zip
Merge pull request #1174 from 0xProject/fix/website/kovan
[website] Fix broken order signing on portal and broken loading on kovan
-rw-r--r--packages/website/ts/blockchain.ts2
-rw-r--r--packages/website/ts/components/portal/portal.tsx19
-rw-r--r--yarn.lock41
3 files changed, 53 insertions, 9 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts
index efb5aef23..62e16dd1d 100644
--- a/packages/website/ts/blockchain.ts
+++ b/packages/website/ts/blockchain.ts
@@ -163,7 +163,7 @@ export class Blockchain {
const providerName = this._getNameGivenProvider(injectedWeb3.currentProvider);
// Wrap Metamask in a compatability wrapper MetamaskSubprovider (to handle inconsistencies)
const signerSubprovider =
- providerName === Providers.Metamask
+ providerName === constants.PROVIDER_NAME_METAMASK
? new MetamaskSubprovider(injectedWeb3.currentProvider)
: new SignerSubprovider(injectedWeb3.currentProvider);
provider.addProvider(signerSubprovider);
diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx
index 2299881c4..94ab63ac6 100644
--- a/packages/website/ts/components/portal/portal.tsx
+++ b/packages/website/ts/components/portal/portal.tsx
@@ -210,12 +210,16 @@ export class Portal extends React.Component<PortalProps, PortalState> {
isLoaded: false,
};
}
- this.setState({
- trackedTokenStateByAddress,
- });
- // Fetch the actual balance/allowance.
- // tslint:disable-next-line:no-floating-promises
- this._fetchBalancesAndAllowancesAsync(newTokenAddresses);
+ this.setState(
+ {
+ trackedTokenStateByAddress,
+ },
+ () => {
+ // Fetch the actual balance/allowance.
+ // tslint:disable-next-line:no-floating-promises
+ this._fetchBalancesAndAllowancesAsync(newTokenAddresses);
+ },
+ );
}
}
public render(): React.ReactNode {
@@ -644,6 +648,9 @@ export class Portal extends React.Component<PortalProps, PortalState> {
}
private async _fetchBalancesAndAllowancesAsync(tokenAddresses: string[]): Promise<void> {
+ if (_.isEmpty(tokenAddresses)) {
+ return;
+ }
const trackedTokenStateByAddress = this.state.trackedTokenStateByAddress;
const userAddressIfExists = _.isEmpty(this.props.userAddress) ? undefined : this.props.userAddress;
const balancesAndAllowances = await Promise.all(
diff --git a/yarn.lock b/yarn.lock
index 6b3219ed6..a49282db9 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1869,6 +1869,10 @@ aes-js@^0.2.3:
version "0.2.4"
resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-0.2.4.tgz#94b881ab717286d015fa219e08fb66709dda5a3d"
+aes-js@^3.1.1:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.1.tgz#89fd1f94ae51b4c72d62466adc1a7323ff52f072"
+
agent-base@4, agent-base@^4.1.0, agent-base@~4.2.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
@@ -3299,7 +3303,7 @@ bs-logger@0.x:
dependencies:
fast-json-stable-stringify "^2.0.0"
-bs58@=4.0.1:
+bs58@=4.0.1, bs58@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a"
dependencies:
@@ -3322,6 +3326,14 @@ bs58check@^1.0.8:
bs58 "^3.1.0"
create-hash "^1.1.0"
+bs58check@^2.1.2:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc"
+ dependencies:
+ bs58 "^4.0.0"
+ create-hash "^1.1.0"
+ safe-buffer "^5.1.2"
+
bser@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719"
@@ -5901,6 +5913,19 @@ ethereumjs-wallet@0.6.0:
utf8 "^2.1.1"
uuid "^2.0.1"
+ethereumjs-wallet@~0.6.0:
+ version "0.6.2"
+ resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.2.tgz#67244b6af3e8113b53d709124b25477b64aeccda"
+ dependencies:
+ aes-js "^3.1.1"
+ bs58check "^2.1.2"
+ ethereumjs-util "^5.2.0"
+ hdkey "^1.0.0"
+ safe-buffer "^5.1.2"
+ scrypt.js "^0.2.0"
+ utf8 "^3.0.0"
+ uuid "^3.3.2"
+
ethers@~4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.4.tgz#d3f85e8b27f4b59537e06526439b0fb15b44dc65"
@@ -6705,7 +6730,7 @@ ganache-core@0xProject/ganache-core#monorepo-dep:
ethereumjs-tx "0xProject/ethereumjs-tx#fake-tx-include-signature-by-default"
ethereumjs-util "^5.2.0"
ethereumjs-vm "2.3.5"
- ethereumjs-wallet "~0.6.0"
+ ethereumjs-wallet "0.6.0"
fake-merkle-patricia-tree "~1.0.1"
heap "~0.2.6"
js-scrypt "^0.2.0"
@@ -7430,6 +7455,14 @@ hdkey@^0.7.0, hdkey@^0.7.1:
coinstring "^2.0.0"
secp256k1 "^3.0.1"
+hdkey@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/hdkey/-/hdkey-1.1.0.tgz#e74e7b01d2c47f797fa65d1d839adb7a44639f29"
+ dependencies:
+ coinstring "^2.0.0"
+ safe-buffer "^5.1.1"
+ secp256k1 "^3.0.1"
+
he@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
@@ -15513,6 +15546,10 @@ utf8@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.2.tgz#1fa0d9270e9be850d9b05027f63519bf46457d96"
+utf8@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1"
+
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"