Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
private _hideTooltip(): void {
ReactTooltip.hide(ReactDOM.findDOMNode(this._copyable));
}
}
componentDidUpdate(prevProps, prevState) {
if(!prevState.showTooltip && this.state.showTooltip) {
ReactTooltip.show(ReactDOM.findDOMNode(this.refs.copyButtonRef));
}
else if(prevState.showTooltip && !this.state.showTooltip) {
ReactTooltip.hide(ReactDOM.findDOMNode(this.refs.copyButtonRef));
}
}
componentWillUnmount() {
ReactTooltip.hide();
}
useEffect(() => {
if (show) {
ReactTooltip.show(findDOMNode(tooltipRef.current))
} else {
ReactTooltip.hide(findDOMNode(tooltipRef.current))
}
})
onClick={() => {
ReactTooltip.hide();
this.showBorrowModal(
asset.get("id"),
asset.getIn([
"bitasset",
"options",
"short_backing_asset"
]),
account
);
}}
>
() =>
this.setState(
{ tooltipText: "", errorIndicator: 0 },
ReactTooltip.hide(this.searchbarRef)
),
time
setTimeout(() => {
ReactTooltip.hide(this.copyLinkButtonContainerRef);
}, 2000);
}
hide() {
ReactTooltip.hide(this.tipRef);
}
render() {