aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils/utils.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-07-18 20:54:47 +0800
committerGitHub <noreply@github.com>2018-07-18 20:54:47 +0800
commitf3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0 (patch)
tree4aacfa2652ba2c5f976e36ac25449decb561d3f0 /packages/website/ts/utils/utils.ts
parent904968cf4a899642d3f4e78abc53352125e17447 (diff)
parentbf8ac3b9e6ee59f267f7850418febfe84dedceb8 (diff)
downloaddexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar
dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar.gz
dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar.bz2
dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar.lz
dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar.xz
dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar.zst
dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.zip
Merge pull request #883 from 0xProject/feature/tslint-improvements
New tslint rules
Diffstat (limited to 'packages/website/ts/utils/utils.ts')
-rw-r--r--packages/website/ts/utils/utils.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index 739bb7b66..e656d5963 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -59,7 +59,7 @@ export const utils = {
return moment.unix(unixTimestampSec.toNumber());
},
convertToReadableDateTimeFromUnixTimestamp(unixTimestampSec: BigNumber): string {
- const m = this.convertToMomentFromUnixTimestamp(unixTimestampSec);
+ const m = utils.convertToMomentFromUnixTimestamp(unixTimestampSec);
const formattedDate: string = m.format('h:MMa MMMM D YYYY');
return formattedDate;
},
@@ -299,12 +299,12 @@ export const utils = {
const baseUrl = `https://${window.location.hostname}${hasPort ? `:${port}` : ''}`;
return baseUrl;
},
- onPageLoadPromise: new Promise((resolve, _reject) => {
+ onPageLoadPromise: new Promise<void>((resolve, _reject) => {
if (document.readyState === 'complete') {
resolve();
return;
}
- window.onload = resolve;
+ window.onload = () => resolve();
}),
getProviderType(provider: Provider): Providers | string {
const constructorName = provider.constructor.name;
@@ -364,7 +364,7 @@ export const utils = {
return Environments.UNKNOWN;
},
shouldShowJobsPage(): boolean {
- return this.isDevelopment() || this.isStaging() || this.isDogfood();
+ return utils.isDevelopment() || utils.isStaging() || utils.isDogfood();
},
getEthToken(tokenByAddress: TokenByAddress): Token {
return utils.getTokenBySymbol(constants.ETHER_TOKEN_SYMBOL, tokenByAddress);
@@ -379,7 +379,7 @@ export const utils = {
},
getTrackedTokens(tokenByAddress: TokenByAddress): Token[] {
const allTokens = _.values(tokenByAddress);
- const trackedTokens = _.filter(allTokens, t => this.isTokenTracked(t));
+ const trackedTokens = _.filter(allTokens, t => utils.isTokenTracked(t));
return trackedTokens;
},
getFormattedAmountFromToken(token: Token, tokenState: TokenState): string {