Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 5, 2021
1 parent 9c7cbdf commit 260d077
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/run/preview/update/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import { goodColor, noteColor } from '../../../report/utils/colors.js'
// Show keys available for user actions in previews.
// When there are no actions available, we keep an empty line to avoid jitter.
export const getActions = function (actions, leftWidth) {
const actionValues = Object.values(actions)

if (actionValues.length === 0) {
if (actions.length === 0) {
return ''
}

const actionsStr = actionValues.map(getAction).join(noteColor(', '))
const actionsStr = actions.map(getAction).join(noteColor(', '))
return `${ACTIONS_LABEL.padEnd(leftWidth)}${actionsStr}`
}

Expand Down

0 comments on commit 260d077

Please sign in to comment.