Skip to content

Commit

Permalink
chore: lint fix + small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonflatval-cognite committed Jun 20, 2024
1 parent 55800f1 commit dfa9b09
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { useTranslation } from '../i18n/I18n';
import { type BaseCommand } from '../../architecture/base/commands/BaseCommand';
import { type RevealRenderTarget } from '../../architecture/base/renderTarget/RevealRenderTarget';
import { RenderTargetCommand } from '../../architecture/base/commands/RenderTargetCommand';
import { CopyToClipboardCommand } from '../../architecture/base/concreteCommands/CopyToClipboardCommand';

export const CommandButtons = ({
commands,
Expand All @@ -25,7 +24,7 @@ export const CommandButtons = ({
<CommandButtonWrapper
command={command}
isHorizontal={isHorizontal}
key={getKey(command, -index)}
key={getKey(command, index)}
/>
)
)}
Expand Down Expand Up @@ -115,7 +114,7 @@ function getDefaultCommand(newCommand: BaseCommand, renderTarget: RevealRenderTa

function getKey(command: BaseCommand | undefined, index: number): number {
if (command === undefined) {
return index;
return -index;
}

return command.uniqueId;
Expand Down

0 comments on commit dfa9b09

Please sign in to comment.