@@ -196,16 +196,8 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
196
196
( port ) => port . agent_name === agent . name ,
197
197
) ;
198
198
// we don't want to show listening ports if it's a shared port
199
- const filteredListeningPorts = ( listeningPorts ? listeningPorts : [ ] ) . filter (
200
- ( port ) => {
201
- for ( let i = 0 ; i < filteredSharedPorts . length ; i ++ ) {
202
- if ( filteredSharedPorts [ i ] . port === port . port ) {
203
- return false ;
204
- }
205
- }
206
-
207
- return true ;
208
- } ,
199
+ const filteredListeningPorts = ( listeningPorts ?? [ ] ) . filter ( ( port ) =>
200
+ filteredSharedPorts . every ( ( sharedPort ) => sharedPort . port !== port . port ) ,
209
201
) ;
210
202
// only disable the form if shared port controls are entitled and the template doesn't allow sharing ports
211
203
const canSharePorts =
@@ -253,9 +245,8 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
253
245
</ Stack >
254
246
< Stack direction = "column" gap = { 1 } >
255
247
< HelpTooltipText css = { { color : theme . palette . text . secondary } } >
256
- {
257
- "The listening ports are exclusively accessible to you. Selecting HTTP/S will change the protocol for all listening ports."
258
- }
248
+ The listening ports are exclusively accessible to you. Selecting
249
+ HTTP/S will change the protocol for all listening ports.
259
250
</ HelpTooltipText >
260
251
< Stack
261
252
direction = "row"
@@ -334,7 +325,7 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
334
325
</ Stack >
335
326
{ filteredListeningPorts . length === 0 && (
336
327
< HelpTooltipText css = { styles . noPortText } >
337
- { " No open ports were detected." }
328
+ No open ports were detected.
338
329
</ HelpTooltipText >
339
330
) }
340
331
{ filteredListeningPorts . map ( ( port ) => {
0 commit comments