How to use the react-toastify.toast.dismiss function in react-toastify

To help you get started, we’ve selected a few react-toastify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MenloOne / block-overflow / src / models / Account.tsx View on Github external
async refreshAccount(reload : boolean, address: string) {
        toast.dismiss()

        if (this.networkName !== NetworkName.Mainnet) {

            if (this.status !== MetamaskStatus.InvalidNetwork) {
                this.status = MetamaskStatus.InvalidNetwork
                this.onStateChange()
            }
            return
        }

        try {
            if (reload) {
                // Easy way out for now
                // TODO: Make all modules refresh all acct based state when setWeb3Account() is called
                window.location.reload()
            }
github Zenika / marcel / frontend / src / components / Client.js View on Github external
this.conn.onmessage = event => {
      console.log('Message received from server : ', event)
      if (event.data === 'update') {
        toast.dismiss()
        toast.warn('Ce Media a été mis à jour')
        this.getClient().then(this.setClient)
      }
    }
github brillout / handli / live-demo / src / cases / custom-ui / customUi.js View on Github external
  const close = () => reactToastify.dismiss(toastId);
  return {update, close};
github MenloOne / block-overflow / src / models / Account.tsx View on Github external
async getBalance(force: boolean = false) : Promise {
        if (!force) {
            await this.ready
        }

        toast.dismiss(ToastType.Balance)

        this.oneBalance = (await this.token.balanceOf(this.address as string)).div( 10 ** 18 ).toNumber()
        web3.eth.getBalance(this.address as string, (err, balance) => {
            if (err || balance === null) {
                throw (err)
            }

            this.ethBalance = balance.div(10 ** 18).toNumber()

            if (this.ethBalance === 0) {
                toast(`Note you have no ETH in this wallet.`, {
                    autoClose: false,
                    toastId: ToastType.Balance
                })
            } else
            if (this.oneBalance === 0) {
github benetech / MathShare / src / scripts / alert.js View on Github external
function dismissAlert(id) {
    toast.dismiss(id);
}
github plone / volto / src / components / theme / Login / Login.jsx View on Github external
componentWillUnmount() {
    if (toast.isActive('loginFailed')) {
      toast.dismiss('loginFailed');
    }
  }
github aamay001 / react-resume / src / helpers / tools.helper.js View on Github external
export const saveTools = (tools) => {
  if (!tools.autoSave && prevLocalStorageState) {
    toast(' ⚠️ Auto save to local storage is now off!', { toastId: 'rrtrlsoff', position: 'top-right', autoClose: false });
  } else if (tools.autoSave && !prevLocalStorageState) {
    toast.dismiss('rrtrlsoffinit');
    toast.dismiss('rrtrlsoff');
    toast(' 💾 Auto save to local storage is now on!', { toastId: 'rrtrlson', position: 'top-right', autoClose: 10000 });
  }
  prevLocalStorageState = tools.autoSave;
  if (ls.setItem(STORED_TOOLS_KEY, tools)) {
    toast.dismiss('rrterrorsaveresume');
    debounce(() => toast(' 💾 saved to local storage...', { toastId: 'rrtresumesaved', position: 'top-right' }),
      100,
      false,
      'rrtresumesaved');
  } else {
    debounce(() => toast(' ⚠️ error saving to local storage...', { toastId: 'rrterrorsaveresume', position: 'top-right' }),
      100,
      false,
      'rrterrorsaveresume');
  }
github aamay001 / react-resume / src / helpers / tools.helper.js View on Github external
export const saveTools = (tools) => {
  if (!tools.autoSave && prevLocalStorageState) {
    toast(' ⚠️ Auto save to local storage is now off!', { toastId: 'rrtrlsoff', position: 'top-right', autoClose: false });
  } else if (tools.autoSave && !prevLocalStorageState) {
    toast.dismiss('rrtrlsoffinit');
    toast.dismiss('rrtrlsoff');
    toast(' 💾 Auto save to local storage is now on!', { toastId: 'rrtrlson', position: 'top-right', autoClose: 10000 });
  }
  prevLocalStorageState = tools.autoSave;
  if (ls.setItem(STORED_TOOLS_KEY, tools)) {
    toast.dismiss('rrterrorsaveresume');
    debounce(() => toast(' 💾 saved to local storage...', { toastId: 'rrtresumesaved', position: 'top-right' }),
      100,
      false,
      'rrtresumesaved');
  } else {
    debounce(() => toast(' ⚠️ error saving to local storage...', { toastId: 'rrterrorsaveresume', position: 'top-right' }),
      100,
      false,
      'rrterrorsaveresume');
  }
  return tools;
github eez-open / studio / packages / eez-studio-ui / notification.tsx View on Github external
export function dismiss(toastId: number) {
    toast.dismiss(toastId);
}
github benetech / MathShare / src / components / SignIn / index.js View on Github external
componentDidMount() {
        this.props.checkUserLogin();
        toast.dismiss('login-alert');
    }