Skip to content

Commit

Permalink
fix: remove unneeded optional chaining (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
emccorson committed Mar 4, 2024
1 parent dad5b77 commit 11757a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/integrations/src/hooks/useIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ export const useIntegration = (
export const useIntegrationConnection = <TSuccess, TFail>(
chainKey: ChainKey
): [
InstanceType<Integration>,
boolean,
ExtensionConnection<TSuccess, TFail>,
] => {
InstanceType<Integration>,
boolean,
ExtensionConnection<TSuccess, TFail>,
] => {
const integration = useIntegration(chainKey);
const [isConnectingToExtension, setIsConnectingToExtension] = useState(false);

const connect: ExtensionConnection<TSuccess, TFail> = useCallback(
async (onSuccess, onFail) => {
setIsConnectingToExtension(true);
try {
if (integration?.detect()) {
await integration?.connect();
if (integration.detect()) {
await integration.connect();
await onSuccess();
}
} catch (e) {
Expand Down

0 comments on commit 11757a6

Please sign in to comment.