diff options
author | Leonid <logvinov.leon@gmail.com> | 2018-02-05 19:33:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-05 19:33:40 +0800 |
commit | 7b4f2b47de393b7ed6d5c264c8e80864d196180c (patch) | |
tree | 8e86af8000e0aedd7241a00c2189d8f7ca0fc2ad /packages/website/ts/redux/dispatcher.ts | |
parent | 400a97e7a8f76d894d47368425bbe1e33fa5b255 (diff) | |
parent | c7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8 (diff) | |
download | dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.gz dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.bz2 dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.lz dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.xz dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.zst dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.zip |
Merge branch 'development' into fix/ether_token_address
Diffstat (limited to 'packages/website/ts/redux/dispatcher.ts')
-rw-r--r-- | packages/website/ts/redux/dispatcher.ts | 56 |
1 files changed, 17 insertions, 39 deletions
diff --git a/packages/website/ts/redux/dispatcher.ts b/packages/website/ts/redux/dispatcher.ts index 42989e5e1..87415b285 100644 --- a/packages/website/ts/redux/dispatcher.ts +++ b/packages/website/ts/redux/dispatcher.ts @@ -9,9 +9,10 @@ import { ProviderType, ScreenWidths, Side, + SideToAssetToken, SignatureData, Token, - TokenStateByAddress, + TokenByAddress, } from 'ts/types'; export class Dispatcher { @@ -120,9 +121,20 @@ export class Dispatcher { type: ActionTypes.RemoveTokenFromTokenByAddress, }); } - public clearTokenByAddress() { + public batchDispatch( + tokenByAddress: TokenByAddress, + networkId: number, + userAddress: string, + sideToAssetToken: SideToAssetToken, + ) { this._dispatch({ - type: ActionTypes.ClearTokenByAddress, + data: { + tokenByAddress, + networkId, + userAddress, + sideToAssetToken, + }, + type: ActionTypes.BatchDispatch, }); } public updateTokenByAddress(tokens: Token[]) { @@ -131,43 +143,9 @@ export class Dispatcher { type: ActionTypes.UpdateTokenByAddress, }); } - public updateTokenStateByAddress(tokenStateByAddress: TokenStateByAddress) { - this._dispatch({ - data: tokenStateByAddress, - type: ActionTypes.UpdateTokenStateByAddress, - }); - } - public removeFromTokenStateByAddress(tokenAddress: string) { - this._dispatch({ - data: tokenAddress, - type: ActionTypes.RemoveFromTokenStateByAddress, - }); - } - public replaceTokenAllowanceByAddress(address: string, allowance: BigNumber) { + public forceTokenStateRefetch() { this._dispatch({ - data: { - address, - allowance, - }, - type: ActionTypes.ReplaceTokenAllowanceByAddress, - }); - } - public replaceTokenBalanceByAddress(address: string, balance: BigNumber) { - this._dispatch({ - data: { - address, - balance, - }, - type: ActionTypes.ReplaceTokenBalanceByAddress, - }); - } - public updateTokenBalanceByAddress(address: string, balanceDelta: BigNumber) { - this._dispatch({ - data: { - address, - balanceDelta, - }, - type: ActionTypes.UpdateTokenBalanceByAddress, + type: ActionTypes.ForceTokenStateRefetch, }); } public updateSignatureData(signatureData: SignatureData) { |