Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Ensure chosen operation is based on id or intent
Browse files Browse the repository at this point in the history
  • Loading branch information
LL782 committed Oct 4, 2024
1 parent 6efd94e commit bfc192d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion developer-preview/src/app/DevicesDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export const DevicesDemo = ({
const { contract, metadata, operations, type } = data;

const chosenOperation =
operations.find(({ id }) => selectedOperation === id) || operations[0];
operations.find(
({ id, intent }) =>
selectedOperation === id || selectedOperation === intent,
) ?? operations[0];

if (!chosenOperation || contract.deployments.length < 1) return null;

Expand Down

0 comments on commit bfc192d

Please sign in to comment.