Upgrade to latest 0x.js version and refactor subscriptions to use latest interface
This commit is contained in:
@@ -31,13 +31,25 @@ export const tradeHistoryStorage = {
|
||||
const fillHash = this._getFillHash(fill);
|
||||
const doesFillExist = !_.isUndefined(fillsByHash[fillHash]);
|
||||
if (doesFillExist) {
|
||||
return;
|
||||
return; // noop
|
||||
}
|
||||
fillsByHash[fillHash] = fill;
|
||||
const userFillsJSONString = JSON.stringify(fillsByHash);
|
||||
const userFillsKey = this._getUserFillsKey(userAddress, networkId);
|
||||
localStorage.setItem(userFillsKey, userFillsJSONString);
|
||||
},
|
||||
removeFillFromUser(userAddress: string, networkId: number, fill: Fill) {
|
||||
const fillsByHash = this.getUserFillsByHash(userAddress, networkId);
|
||||
const fillHash = this._getFillHash(fill);
|
||||
const doesFillExist = !_.isUndefined(fillsByHash[fillHash]);
|
||||
if (!doesFillExist) {
|
||||
return; // noop
|
||||
}
|
||||
delete fillsByHash[fillHash];
|
||||
const userFillsJSONString = JSON.stringify(fillsByHash);
|
||||
const userFillsKey = this._getUserFillsKey(userAddress, networkId);
|
||||
localStorage.setItem(userFillsKey, userFillsJSONString);
|
||||
},
|
||||
getUserFillsByHash(userAddress: string, networkId: number): {[fillHash: string]: Fill} {
|
||||
const userFillsKey = this._getUserFillsKey(userAddress, networkId);
|
||||
const userFillsJSONString = localStorage.getItemIfExists(userFillsKey);
|
||||
|
Reference in New Issue
Block a user