Merge pull request #325 from 0xProject/fix/portal-bugs
Small Fixes/Additions
This commit is contained in:
BIN
packages/website/public/images/social/discourse.png
Normal file
BIN
packages/website/public/images/social/discourse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -372,10 +372,14 @@ export class Blockchain {
|
|||||||
const [balance] = await this.getTokenBalanceAndAllowanceAsync(this._userAddress, token.address);
|
const [balance] = await this.getTokenBalanceAndAllowanceAsync(this._userAddress, token.address);
|
||||||
if (!balance.eq(currBalance)) {
|
if (!balance.eq(currBalance)) {
|
||||||
this._dispatcher.replaceTokenBalanceByAddress(token.address, balance);
|
this._dispatcher.replaceTokenBalanceByAddress(token.address, balance);
|
||||||
clearInterval(this._zrxPollIntervalId);
|
intervalUtils.clearAsyncExcludingInterval(this._zrxPollIntervalId);
|
||||||
delete this._zrxPollIntervalId;
|
delete this._zrxPollIntervalId;
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 5000, (err: Error) => {
|
||||||
|
utils.consoleLog(`Polling tokenBalance failed: ${err}`);
|
||||||
|
intervalUtils.clearAsyncExcludingInterval(this._zrxPollIntervalId);
|
||||||
|
delete this._zrxPollIntervalId;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
public async signOrderHashAsync(orderHash: string): Promise<SignatureData> {
|
public async signOrderHashAsync(orderHash: string): Promise<SignatureData> {
|
||||||
utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.');
|
utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.');
|
||||||
@@ -471,7 +475,7 @@ export class Blockchain {
|
|||||||
this._web3Wrapper.updatePrevUserAddress(newUserAddress);
|
this._web3Wrapper.updatePrevUserAddress(newUserAddress);
|
||||||
}
|
}
|
||||||
public destroy() {
|
public destroy() {
|
||||||
clearInterval(this._zrxPollIntervalId);
|
intervalUtils.clearAsyncExcludingInterval(this._zrxPollIntervalId);
|
||||||
this._web3Wrapper.destroy();
|
this._web3Wrapper.destroy();
|
||||||
this._stopWatchingExchangeLogFillEvents();
|
this._stopWatchingExchangeLogFillEvents();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ interface FooterMenuItem {
|
|||||||
title: string;
|
title: string;
|
||||||
path?: string;
|
path?: string;
|
||||||
isExternal?: boolean;
|
isExternal?: boolean;
|
||||||
fileName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Sections {
|
enum Sections {
|
||||||
@@ -56,25 +55,26 @@ const menuItemsBySection: MenuItemsBySection = {
|
|||||||
title: 'Rocket.chat',
|
title: 'Rocket.chat',
|
||||||
isExternal: true,
|
isExternal: true,
|
||||||
path: constants.URL_ZEROEX_CHAT,
|
path: constants.URL_ZEROEX_CHAT,
|
||||||
fileName: 'rocketchat.png',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Blog',
|
title: 'Blog',
|
||||||
isExternal: true,
|
isExternal: true,
|
||||||
path: constants.URL_BLOG,
|
path: constants.URL_BLOG,
|
||||||
fileName: 'medium.png',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Twitter',
|
title: 'Twitter',
|
||||||
isExternal: true,
|
isExternal: true,
|
||||||
path: constants.URL_TWITTER,
|
path: constants.URL_TWITTER,
|
||||||
fileName: 'twitter.png',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Reddit',
|
title: 'Reddit',
|
||||||
isExternal: true,
|
isExternal: true,
|
||||||
path: constants.URL_REDDIT,
|
path: constants.URL_REDDIT,
|
||||||
fileName: 'reddit.png',
|
},
|
||||||
|
{
|
||||||
|
title: 'Forum',
|
||||||
|
isExternal: true,
|
||||||
|
path: constants.URL_DISCOURSE_FORUM,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
Organization: [
|
Organization: [
|
||||||
@@ -105,6 +105,7 @@ const titleToIcon: { [title: string]: string } = {
|
|||||||
Blog: 'medium.png',
|
Blog: 'medium.png',
|
||||||
Twitter: 'twitter.png',
|
Twitter: 'twitter.png',
|
||||||
Reddit: 'reddit.png',
|
Reddit: 'reddit.png',
|
||||||
|
Forum: 'discourse.png',
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface FooterProps {}
|
export interface FooterProps {}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
|
|||||||
? 'In order to try out the 0x Portal Dapp, request some test ether to pay for \
|
? 'In order to try out the 0x Portal Dapp, request some test ether to pay for \
|
||||||
gas costs. It might take a bit of time for the test ether to show up.'
|
gas costs. It might take a bit of time for the test ether to show up.'
|
||||||
: 'Ether must be converted to Ether Tokens in order to be tradable via 0x. \
|
: 'Ether must be converted to Ether Tokens in order to be tradable via 0x. \
|
||||||
You can convert between Ether and Ether Tokens by clicking the "convert" button below.'}
|
You can convert between Ether and Ether Tokens from the "Wrap ETH" tab.'}
|
||||||
</div>
|
</div>
|
||||||
<Table selectable={false} style={styles.bgColor}>
|
<Table selectable={false} style={styles.bgColor}>
|
||||||
<TableHeader displaySelectAll={false} adjustForCheckbox={false}>
|
<TableHeader displaySelectAll={false} adjustForCheckbox={false}>
|
||||||
|
|||||||
@@ -167,15 +167,13 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{this.props.blockchainIsLoaded &&
|
{this.props.blockchainIsLoaded && _.isEmpty(this.props.userAddress) &&
|
||||||
!_.isEmpty(this.props.userAddress) && <div className="col col-5">{this._renderUser()}</div>}
|
<div className="col col-5 sm-hide xs-hide">{this._renderUser()}</div>}
|
||||||
{!this._isViewingPortal() && (
|
<div className={`col ${isFullWidthPage ? 'col-2 pl2' : 'col-1'} md-hide lg-hide`}>
|
||||||
<div className={`col ${isFullWidthPage ? 'col-2 pl2' : 'col-1'} md-hide lg-hide`}>
|
<div style={menuIconStyle}>
|
||||||
<div style={menuIconStyle}>
|
<i className="zmdi zmdi-menu" onClick={this._onMenuButtonClick.bind(this)} />
|
||||||
<i className="zmdi zmdi-menu" onClick={this._onMenuButtonClick.bind(this)} />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{this._renderDrawer()}
|
{this._renderDrawer()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ export const constants = {
|
|||||||
URL_BIGNUMBERJS_GITHUB: 'http://mikemcl.github.io/bignumber.js',
|
URL_BIGNUMBERJS_GITHUB: 'http://mikemcl.github.io/bignumber.js',
|
||||||
URL_BITLY_API: 'https://api-ssl.bitly.com',
|
URL_BITLY_API: 'https://api-ssl.bitly.com',
|
||||||
URL_BLOG: 'https://blog.0xproject.com/latest',
|
URL_BLOG: 'https://blog.0xproject.com/latest',
|
||||||
|
URL_DISCOURSE_FORUM: 'https://forum.0xproject.com',
|
||||||
URL_FIREFOX_U2F_ADDON: 'https://addons.mozilla.org/en-US/firefox/addon/u2f-support-add-on/',
|
URL_FIREFOX_U2F_ADDON: 'https://addons.mozilla.org/en-US/firefox/addon/u2f-support-add-on/',
|
||||||
URL_ETHER_FAUCET: 'https://faucet.0xproject.com',
|
URL_ETHER_FAUCET: 'https://faucet.0xproject.com',
|
||||||
URL_GITHUB_ORG: 'https://github.com/0xProject',
|
URL_GITHUB_ORG: 'https://github.com/0xProject',
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { BigNumber, intervalUtils, promisify } from '@0xproject/utils';
|
import { BigNumber, intervalUtils, promisify } from '@0xproject/utils';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
import { Dispatcher } from 'ts/redux/dispatcher';
|
import { Dispatcher } from 'ts/redux/dispatcher';
|
||||||
|
import { utils } from 'ts/utils/utils';
|
||||||
import * as Web3 from 'web3';
|
import * as Web3 from 'web3';
|
||||||
|
|
||||||
export class Web3Wrapper {
|
export class Web3Wrapper {
|
||||||
@@ -135,7 +136,10 @@ export class Web3Wrapper {
|
|||||||
await this._updateUserEtherBalanceAsync(this._prevUserAddress);
|
await this._updateUserEtherBalanceAsync(this._prevUserAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 5000, (err: Error) => {
|
||||||
|
utils.consoleLog(`Watching network and balances failed: ${err}`);
|
||||||
|
this._stopEmittingNetworkConnectionAndUserBalanceStateAsync();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
private async _updateUserEtherBalanceAsync(userAddress: string) {
|
private async _updateUserEtherBalanceAsync(userAddress: string) {
|
||||||
const balance = await this.getBalanceInEthAsync(userAddress);
|
const balance = await this.getBalanceInEthAsync(userAddress);
|
||||||
@@ -145,6 +149,6 @@ export class Web3Wrapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private _stopEmittingNetworkConnectionAndUserBalanceStateAsync() {
|
private _stopEmittingNetworkConnectionAndUserBalanceStateAsync() {
|
||||||
clearInterval(this._watchNetworkAndBalanceIntervalId);
|
intervalUtils.clearAsyncExcludingInterval(this._watchNetworkAndBalanceIntervalId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user