Skip to content

Commit

Permalink
fix hoisting
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Apr 15, 2024
1 parent 35d5002 commit 6cc92fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions extension/src/flow-cli/cli-selection-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ export class CliSelectionProvider {
items.push(new CustomBinaryItem())

// Hoist the current binary to the top of the list
const currentBinaryIndex = items.findIndex(item => item instanceof AvailableBinaryItem && item.command === currentBinary?.command)
if (currentBinaryIndex != null) {
const currentBinaryIndex = items.findIndex(item =>
item instanceof AvailableBinaryItem &&
currentBinary != null &&
item.command === currentBinary.command
)
if (currentBinaryIndex !== -1) {
const currentBinaryItem = items[currentBinaryIndex]
items.splice(currentBinaryIndex, 1)
items.unshift(currentBinaryItem)
Expand Down

0 comments on commit 6cc92fc

Please sign in to comment.