Bug 1650527 - Clear messages button hides filter menu in websocket inspector. r=bomsy,Honza

Differential Revision: https://phabricator.services.mozilla.com/D83478
This commit is contained in:
Farooq AR 2020-07-16 12:36:30 +00:00
Родитель af8c105fc0
Коммит 824fe434f2
1 изменённых файлов: 7 добавлений и 13 удалений

Просмотреть файл

@ -174,21 +174,15 @@ function openMessageDetails(state, action) {
*/
function clearMessages(state) {
const nextState = { ...state };
nextState.messages = new Map(nextState.messages);
const defaultState = Messages();
nextState.messages = new Map(state.messages);
nextState.messages.delete(nextState.currentChannelId);
return {
...Messages(),
// Preserving the Map objects as they might contain state for other channelIds
messages: nextState.messages,
// Preserving the currentChannelId as there would not be another reset of channelId
currentChannelId: nextState.currentChannelId,
// Preserving the columns as they are set from pref
columns: nextState.columns,
messageFilterType: nextState.messageFilterType,
messageFilterText: nextState.messageFilterText,
showControlFrames: nextState.showControlFrames,
};
// Reset fields to default state.
nextState.selectedMessage = defaultState.selectedMessage;
nextState.messageDetailsOpen = defaultState.messageDetailsOpen;
return nextState;
}
/**