Skip to content

Commit

Permalink
feat: infer types
Browse files Browse the repository at this point in the history
  • Loading branch information
andreicovaciu committed May 13, 2024
1 parent 8fca0f8 commit 11c839e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
createAction,
StartExchangeErrorResult,
StartExchangeSuccessResult,
Result,
} from "@ledgerhq/live-common/hw/actions/startExchange";
import startExchange from "@ledgerhq/live-common/exchange/platform/startExchange";
import connectApp from "@ledgerhq/live-common/hw/connectApp";
Expand Down Expand Up @@ -152,7 +151,7 @@ export const LiveAppDrawer = () => {
<DeviceAction
action={action}
request={data}
onResult={(result: Result) => {
onResult={result => {
if ("startExchangeResult" in result) {
data.onResult(result.startExchangeResult);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,7 @@ export const PlatformAPIWebview = forwardRef<WebviewAPI, WebviewProps>(
exchangeType,
provider,
},
onResult: (result: {
startExchangeResult?: { nonce: string; device: Device };
startExchangeError?: { error: Error; device?: Device };
device?: Device;
}) => {
onResult: result => {
if (result.startExchangeError) {
tracking.platformStartExchangeFail(manifest);
reject(result.startExchangeError.error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,7 @@ function useUiHook(): UiHook {
request: {
exchangeType: ExchangeType[exchangeType],
},
onResult: (result: {
startExchangeResult?: { nonce: string; device: Device };
startExchangeError?: { error: Error; device?: Device };
device?: Device;
}) => {
onResult: result => {
if (result.startExchangeError) {
onCancel(result.startExchangeError.error);
}
Expand Down

0 comments on commit 11c839e

Please sign in to comment.