Skip to content

Commit

Permalink
chore: refactor error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
njokuScript committed Apr 2, 2022
1 parent 18e4e0a commit 4a80eb8
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/lazerpay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const Lazerpay = (props: PaymentProps) => {
};

if (openSDK) {
console.log(checkPropsValue);
checkProps();
}
}, [
Expand Down Expand Up @@ -122,19 +121,22 @@ const Lazerpay = (props: PaymentProps) => {

return (
<SDKWrapper visible={openSDK} onRequestClose={onClose}>
<WebView
ref={webviewRef}
source={{
uri: 'https://lazerpay-react-native-59mryqtbi-lazerpay.vercel.app',
}}
onMessage={messageReceived}
onLoadEnd={() => injectValues()}
renderError={(error) => <ErrorFallback {...{ onClose, error }} />}
cacheEnabled={false}
cacheMode={'LOAD_NO_CACHE'}
startInLoadingState={true}
renderLoading={() => <Loader />}
/>
{checkPropsValue ? (
<WebView
ref={webviewRef}
source={{
uri: 'https://lazerpay-react-native-59mryqtbi-lazerpay.vercel.app',
}}
onMessage={messageReceived}
onLoadEnd={() => injectValues()}
cacheEnabled={false}
cacheMode={'LOAD_NO_CACHE'}
startInLoadingState={true}
renderLoading={() => <Loader />}
/>
) : (
<ErrorFallback onClose={onClose} error />
)}
</SDKWrapper>
);
};
Expand Down

1 comment on commit 4a80eb8

@vercel
Copy link

@vercel vercel bot commented on 4a80eb8 Apr 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.