MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / componentDidUpdate

Function componentDidUpdate

src/components/util/Notifications.js:19–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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(() => {

Callers

nothing calls this directly

Calls 1

setStateMethod · 0.45

Tested by

no test coverage detected