Skip to content

Commit 91ba8b1

Browse files
committed
remove async within forEach
1 parent ad52466 commit 91ba8b1

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,7 @@ function closeSessionWhenAllEditorsClosed(
269269
}
270270

271271
function isLiveTailSessionOpenInAnyTab(liveTailSession: LiveTailSession) {
272-
let isOpen = false
273-
vscode.window.tabGroups.all.forEach(async (tabGroup) => {
274-
tabGroup.tabs.forEach((tab) => {
275-
if (tab.input instanceof vscode.TabInputText) {
276-
if (liveTailSession.uri.toString() === tab.input.uri.toString()) {
277-
isOpen = true
278-
}
279-
}
280-
})
281-
})
282-
return isOpen
272+
const isOpen = (tab: vscode.Tab) =>
273+
tab.input instanceof vscode.TabInputText && tab.input.uri.toString() === liveTailSession.uri.toString()
274+
return vscode.window.tabGroups.all.some((tabGroup) => tabGroup.tabs.some(isOpen))
283275
}

0 commit comments

Comments
 (0)