MCPcopy Create free account
hub / github.com/CommE2E/comm / componentDidUpdate

Method componentDidUpdate

lib/components/report-handler.react.js:37–57  ·  view source on GitHub ↗
(prevProps: Props)

Source from the content-addressed store, hash-verified

35 }
36
37 componentDidUpdate(prevProps: Props) {
38 if (!this.props.canSendReports) {
39 return;
40 }
41
42 const couldSend = prevProps.canSendReports;
43 const curReports = this.props.queuedReports;
44 if (!couldSend) {
45 this.dispatchSendReports(curReports);
46 return;
47 }
48
49 const prevReports = prevProps.queuedReports;
50 if (curReports !== prevReports) {
51 const prevResponses = new Set(prevReports);
52 const newResponses = curReports.filter(
53 response => !prevResponses.has(response),
54 );
55 this.dispatchSendReports(newResponses);
56 }
57 }
58
59 render(): React.Node {
60 return null;

Callers

nothing calls this directly

Calls 2

dispatchSendReportsMethod · 0.95
hasMethod · 0.65

Tested by

no test coverage detected