diff --git a/CHANGELOG.md b/CHANGELOG.md index 34f33c64fa6..523119ab7f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ **Bug fixes** - `EuiButton`, `EuiButtonEmpty`, and `EuiButtonIcon` now look and behave disabled when `isDisabled={true}` ([#862](https://github.com/elastic/eui/pull/862)) +- `EuiGlobalToastList` no longer triggers `Uncaught TypeError: _this.callback is not a function` ([#865](https://github.com/elastic/eui/pull/865)) ## [`0.0.49`](https://github.com/elastic/eui/tree/v0.0.49) diff --git a/src/services/time/timer.js b/src/services/time/timer.js index 1b227f2f54b..56fdd5d1501 100644 --- a/src/services/time/timer.js +++ b/src/services/time/timer.js @@ -14,6 +14,7 @@ export class Timer { resume = () => { this.id = setTimeout(this.finish, this.timeRemaining); + this.finishTime = Date.now() + this.timeRemaining; this.timeRemaining = undefined; }; @@ -26,7 +27,9 @@ export class Timer { }; finish = () => { - this.callback(); + if (this.callback) { + this.callback(); + } this.clear(); }; }