зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
af8c105fc0
Коммит
824fe434f2
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче