crazycodeboy/react-native-easy-toast

Showing twice in quick succession, but doesn't extend the duration...

nickgrealy opened this issue · 0 comments

Actual behaviour:

If I run the following code...

this._toast.show('Message One', 1000)
// wait 500ms
this._toast.show('Message Two', 5000)

The second message text will replace the first, however the toaster popup will still fade 500ms later (total 1 second, instead of the 5 seconds supplied).

Expected behaviour:

When running the second "show", the message text changes, AND the popup stays open for a further 5 seconds.

Is there a way to cancel or reset the existing timer countdown?
(Preferably other than manually using setTimeout/clearTimeout.)

Usage:

<Toast 
  ref={c => this._toast = c}
  style={{backgroundColor: 'red', width: _windowWidth - 20}}
  position='top'
  positionValue={20}
  fadeInDuration={1000}
  fadeOutDuration={1000}
  opacity={1}
  textStyle={{color: 'white'}}
/>