Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidUpdate({ location: previousLocation }, { namespaceOption: previousNamespace }) {
const { location } = this.props
const { namespaceOption } = this.state
const namespace = namespaceOption.value
const prevNamespace = previousNamespace.value
if (location.pathname !== previousLocation.pathname || namespace !== prevNamespace) {
this.setEventSourceStream(location.pathname, namespace)
}
// this is required to make tool tips show.
ReactTooltip.rebuild()
}
private async _onToggleAllowanceAsync(): Promise {
// Close all tooltips
ReactTooltip.hide();
if (this.props.userAddress === '') {
this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
return;
}
let newAllowanceAmountInBaseUnits = new BigNumber(0);
if (!this._isAllowanceSet()) {
newAllowanceAmountInBaseUnits = DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS;
}
const isUnlockingToken = newAllowanceAmountInBaseUnits.gt(0);
this.setState({
allowanceState: AllowanceState.Loading,
loadingMessage: `${isUnlockingToken ? 'Unlocking' : 'Locking'} ${this.props.token.symbol}`,
});
const logData = {
tokenSymbol: this.props.token.symbol,
endDrag() {
ReactTooltip.show() // enable tooltips
},
}
onAfterOpen={() => ReactTooltip.rebuild()}
{...props}
middleware.push(store => next => action => {
const prevState = store.getState()
const result = next(action)
if (prevState !== store.getState()) ReactTooltip.rebuild()
return result
})
componentDidUpdate () {
ReactTooltip.rebuild()
}
componentDidUpdate(prevProps, prevState) {
let {form} = this.state
let annual_key_change = form.annual_viewer_key != prevState.form.annual_viewer_key
if (annual_key_change) ReactTooltip.rebuild()
}
componentDidUpdate() {
ReactTooltip.rebuild();
}
componentDidMount() {
if (this.props.tooltip) ReactTooltip.rebuild();
}