* @param {function():!Promise} callback * @return {!Promise} * @private
(callback)
| 12003 | * @private |
| 12004 | */ |
| 12005 | animate_(callback) { |
| 12006 | const wait = this.animating_ || Promise.resolve(); |
| 12007 | return (this.animating_ = wait |
| 12008 | .then(() => callback()) |
| 12009 | // Ignore errors to make sure animations don't get stuck. |
| 12010 | .catch(() => {}) |
| 12011 | .then(() => { |
| 12012 | this.animating_ = null; |
| 12013 | })); |
| 12014 | } |
| 12015 | |
| 12016 | /** |
| 12017 | * Closes the toast. |