From 0cc67f3db45d8bed7c83d6fe62deeff84aa5f390 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Tue, 22 May 2018 15:51:14 -0600 Subject: [PATCH 1/2] ensure that a timer has not already been cleared when calling the callback --- src/services/time/timer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(); }; } From 3b15471fb242859973f850a1391e92f5d8c1008a Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Tue, 22 May 2018 16:18:31 -0600 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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)