/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** * Returns list of messages that are visible to the user. * Filtered messages by types and text are factored in.
*/ const getDisplayedMessages = createSelector(
state => state.messages,
({
messages,
messageFilterType,
showControlFrames,
messageFilterText,
currentChannelId,
}) => { if (!currentChannelId || !messages.get(currentChannelId)) { return [];
}
function regexFromText(text) { returnnew RegExp(text.slice(1, -1), "im");
}
/** * Checks if the selected message is visible. * If the selected message is not visible, the SplitBox component * should not show the MessagePayload component.
*/ const isSelectedMessageVisible = createSelector(
state => state.messages,
getDisplayedMessages,
({ selectedMessage }, displayedMessages) =>
displayedMessages.some(message => message === selectedMessage)
);
/** * Returns the current selected message.
*/ const getSelectedMessage = createSelector(
state => state.messages,
({ selectedMessage }) => (selectedMessage ? selectedMessage : undefined)
);
/** * Returns summary data of the list of messages that are visible to the user. * Filtered messages by types and text are factored in.
*/ const getDisplayedMessagesSummary = createSelector(
getDisplayedMessages,
displayedMessages => {
let firstStartedMs = +Infinity;
let lastEndedMs = -Infinity;
let sentSize = 0;
let receivedSize = 0;
let totalSize = 0;
/** * Returns if the currentChannelId is closed
*/ const isCurrentChannelClosed = createSelector(
state => state.messages,
({ closedConnections, currentChannelId }) =>
closedConnections.has(currentChannelId)
);
/** * Returns the closed connection details of the currentChannelId * Null, if the connection is still open
*/ const getClosedConnectionDetails = createSelector(
state => state.messages,
({ closedConnections, currentChannelId }) =>
closedConnections.get(currentChannelId)
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.