diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-10 19:39:37 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-10 19:43:50 +0800 |
commit | e34b0af25133629ad4c177c4d7d5050bd6ac19b8 (patch) | |
tree | 936eae17521984e5ccc28057973461e707322326 /packages/website/ts/local_storage | |
parent | fa7237fde7acea32c5492f0dcdef4d55b3ade6e1 (diff) | |
download | dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.gz dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.zst dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.zip |
Fix ts error in portal after enabling more strict checks
Diffstat (limited to 'packages/website/ts/local_storage')
-rw-r--r-- | packages/website/ts/local_storage/tracked_token_storage.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/website/ts/local_storage/tracked_token_storage.ts b/packages/website/ts/local_storage/tracked_token_storage.ts index 0cc384791..7733e8436 100644 --- a/packages/website/ts/local_storage/tracked_token_storage.ts +++ b/packages/website/ts/local_storage/tracked_token_storage.ts @@ -1,6 +1,6 @@ import * as _ from 'lodash'; import { localStorage } from 'ts/local_storage/local_storage'; -import { Token, TrackedTokensByNetworkId } from 'ts/types'; +import { Token, TrackedTokensByUserAddress } from 'ts/types'; import { configs } from 'ts/utils/configs'; const TRACKED_TOKENS_KEY = 'trackedTokens'; @@ -9,14 +9,14 @@ const TRACKED_TOKENS_CLEAR_KEY = 'lastClearTrackedTokensDate'; export const trackedTokenStorage = { // Clear trackedTokens localStorage if we've updated the config variable in an update // that introduced a backward incompatible change requiring the tracked tokens to be re-set - clearIfRequired() { + clearIfRequired(): void { const lastClearFillDate = localStorage.getItemIfExists(TRACKED_TOKENS_CLEAR_KEY); if (lastClearFillDate !== configs.LAST_LOCAL_STORAGE_TRACKED_TOKEN_CLEARANCE_DATE) { localStorage.removeItem(TRACKED_TOKENS_KEY); } localStorage.setItem(TRACKED_TOKENS_CLEAR_KEY, configs.LAST_LOCAL_STORAGE_TRACKED_TOKEN_CLEARANCE_DATE); }, - addTrackedTokenToUser(userAddress: string, networkId: number, token: Token) { + addTrackedTokenToUser(userAddress: string, networkId: number, token: Token): void { const trackedTokensByUserAddress = this.getTrackedTokensByUserAddress(); let trackedTokensByNetworkId = trackedTokensByUserAddress[userAddress]; if (_.isUndefined(trackedTokensByNetworkId)) { @@ -31,7 +31,7 @@ export const trackedTokenStorage = { const trackedTokensByUserAddressJSONString = JSON.stringify(trackedTokensByUserAddress); localStorage.setItem(TRACKED_TOKENS_KEY, trackedTokensByUserAddressJSONString); }, - getTrackedTokensByUserAddress(): TrackedTokensByNetworkId { + getTrackedTokensByUserAddress(): TrackedTokensByUserAddress { const trackedTokensJSONString = localStorage.getItemIfExists(TRACKED_TOKENS_KEY); if (_.isEmpty(trackedTokensJSONString)) { return {}; @@ -52,7 +52,7 @@ export const trackedTokenStorage = { const trackedTokens = trackedTokensByNetworkId[networkId]; return trackedTokens; }, - removeTrackedToken(userAddress: string, networkId: number, tokenAddress: string) { + removeTrackedToken(userAddress: string, networkId: number, tokenAddress: string): void { const trackedTokensByUserAddress = this.getTrackedTokensByUserAddress(); const trackedTokensByNetworkId = trackedTokensByUserAddress[userAddress]; const trackedTokens = trackedTokensByNetworkId[networkId]; |