File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,7 @@ export class HttpDetailsPane extends React.Component<{
469469 isPaidUser = { this . props . accountStore ! . isPaidUser }
470470 filenamePrefix = { filenamePrefix }
471471 messages = { exchange . messages }
472+ onClearMessages = { ( ) => exchange . downstream . cleanupMessages ( ) }
472473 /> ;
473474 }
474475
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ export class StreamMessageListCard extends React.Component<ExpandableCardProps &
4545 streamLabel ?: string ,
4646 messages : Array < StreamMessage > ,
4747 editorNode : portals . HtmlPortalNode < typeof SelfSizedEditor >
48+ onClearMessages ?: ( ) => void ,
4849} > {
4950
5051 @observable
@@ -67,6 +68,7 @@ export class StreamMessageListCard extends React.Component<ExpandableCardProps &
6768 expanded,
6869 onCollapseToggled,
6970 onExpandToggled,
71+ onClearMessages,
7072 ariaLabel
7173 } = this . props ;
7274
@@ -92,6 +94,12 @@ export class StreamMessageListCard extends React.Component<ExpandableCardProps &
9294 disabled = { ! isPaidUser }
9395 onClick = { this . exportMessages }
9496 />
97+ { onClearMessages &&
98+ < IconButton
99+ icon = { [ 'fas' , 'ban' ] }
100+ title = "Clear all messages"
101+ onClick = { onClearMessages }
102+ /> }
95103 </ CollapsingButtons >
96104 { streamLabel && < Pill
97105 color = { getSummaryColor ( 'data' ) }
Original file line number Diff line number Diff line change @@ -127,11 +127,15 @@ export class WebSocketStream extends HttpExchange implements WebSocketView {
127127 this . upstream . updateWithRequestHead ( params ) ;
128128 }
129129
130- cleanup ( ) {
131- super . cleanup ( ) ;
132-
130+ @action
131+ cleanupMessages ( ) {
133132 // Clear all websocket message data too
134133 this . messages . forEach ( msg => msg . cleanup ( ) ) ;
135134 this . messages . length = 0 ;
136135 }
136+
137+ cleanup ( ) {
138+ super . cleanup ( ) ;
139+ this . cleanupMessages ( ) ;
140+ }
137141}
You can’t perform that action at this time.
0 commit comments