()
| 17 | } |
| 18 | |
| 19 | componentDidUpdate() { |
| 20 | const newItems = []; |
| 21 | for (const item of this.props.items) { |
| 22 | if (!this.state.queue.find(existingItem => existingItem.id === item.id)) { |
| 23 | newItems.unshift({...item, show: true}); |
| 24 | } |
| 25 | } |
| 26 | if (newItems.length) { |
| 27 | this.setState(prevState => ({queue: newItems.concat(prevState.queue)})); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | hideNotification(id, timeout = 0) { |
| 32 | setTimeout(() => { |