Skip to content

Commit

Permalink
[DX-2954] feat: always return an error if 'success' is false (#1947)
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 authored Jun 27, 2024
1 parent 515efce commit 8add4cb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/game-bridge/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ window.callFunction = async (jsonData: string) => {
responseFor: fxName,
requestId,
success: true,
code: response?.code,
deviceCode: response?.deviceCode,
url: response?.url,
interval: response?.interval,
code: response.code,
deviceCode: response.deviceCode,
url: response.url,
interval: response.interval,
});
break;
}
Expand All @@ -247,6 +247,7 @@ window.callFunction = async (jsonData: string) => {
responseFor: fxName,
requestId,
success: userInfo !== null,
error: userInfo === null ? 'Failed to re-login' : undefined,
});
break;
}
Expand All @@ -268,6 +269,7 @@ window.callFunction = async (jsonData: string) => {
responseFor: fxName,
requestId,
success: providerSet,
error: !providerSet ? 'Failed to reconnect' : undefined,
});
break;
}
Expand Down Expand Up @@ -320,6 +322,7 @@ window.callFunction = async (jsonData: string) => {
responseFor: fxName,
requestId,
success: providerSet,
error: !providerSet ? 'Failed to connect via PKCE' : undefined,
});
break;
}
Expand Down Expand Up @@ -366,6 +369,7 @@ window.callFunction = async (jsonData: string) => {
responseFor: fxName,
requestId,
success: providerSet,
error: !providerSet ? 'Failed to connect' : undefined,
});
break;
}
Expand Down Expand Up @@ -543,6 +547,7 @@ window.callFunction = async (jsonData: string) => {
responseFor: fxName,
requestId,
success: providerSet,
error: !providerSet ? 'Failed to connect to EVM' : undefined,
});
break;
}
Expand Down

0 comments on commit 8add4cb

Please sign in to comment.