Bug 1404138 - Properly dispatch actions; r=nchevobbe

MozReview-Commit-ID: 2jMTXUzAvAh

--HG--
extra : rebase_source : 7e4de60a9b95314db59c571600931b64ea78412a
This commit is contained in:
Jan Odvarko 2017-10-03 12:42:04 +02:00
parent ecf8dd8c3f
commit a424aad1f6

View File

@ -266,24 +266,25 @@ NewConsoleOutputWrapper.prototype = {
if (this.queuedMessageUpdates.length > 0) {
this.queuedMessageUpdates.forEach(({ message, res }) => {
actions.networkMessageUpdate(message);
store.dispatch(actions.networkMessageUpdate(message));
this.jsterm.hud.emit("network-message-updated", res);
});
this.queuedMessageUpdates = [];
}
if (this.queuedRequestUpdates.length > 0) {
this.queuedRequestUpdates.forEach(({ id, data}) => {
actions.networkUpdateRequest(id, data);
// Fire an event indicating that all data fetched from
// the backend has been received. This is based on
// 'FirefoxDataProvider.isQueuePayloadReady', see more
// comments in that method.
// (netmonitor/src/connector/firefox-data-provider).
// This event might be utilized in tests to find the right
// time when to finish.
this.jsterm.hud.emit("network-request-payload-ready", {id, data});
store.dispatch(actions.networkUpdateRequest(id, data));
});
this.queuedRequestUpdates = [];
// Fire an event indicating that all data fetched from
// the backend has been received. This is based on
// 'FirefoxDataProvider.isQueuePayloadReady', see more
// comments in that method.
// (netmonitor/src/connector/firefox-data-provider).
// This event might be utilized in tests to find the right
// time when to finish.
this.jsterm.hud.emit("network-request-payload-ready");
}
}, 50);
},