Remove isTracked field on token in favor of trackedTimestamp
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import Dialog from 'material-ui/Dialog';
|
||||
import FlatButton from 'material-ui/FlatButton';
|
||||
import * as moment from 'moment';
|
||||
import * as React from 'react';
|
||||
import { Blockchain } from 'ts/blockchain';
|
||||
import { TrackTokenConfirmation } from 'ts/components/track_token_confirmation';
|
||||
@@ -73,12 +74,13 @@ export class TrackTokenConfirmationDialog extends React.Component<
|
||||
this.setState({
|
||||
isAddingTokenToTracked: true,
|
||||
});
|
||||
const currentTimestamp = moment().unix();
|
||||
for (const token of this.props.tokens) {
|
||||
const newTokenEntry = {
|
||||
...token,
|
||||
trackedTimestamp: currentTimestamp,
|
||||
};
|
||||
|
||||
newTokenEntry.isTracked = true;
|
||||
trackedTokenStorage.addTrackedTokenToUser(this.props.userAddress, this.props.networkId, newTokenEntry);
|
||||
this.props.dispatcher.updateTokenByAddress([newTokenEntry]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user