@paypal/common-components
Advanced tools
Comparing version 1.0.42 to 1.0.43
{ | ||
"name": "@paypal/common-components", | ||
"version": "1.0.42", | ||
"version": "1.0.43", | ||
"description": "PayPal common components, for integrating checkout products.", | ||
@@ -5,0 +5,0 @@ "main": "dist/ui.js", |
@@ -24,3 +24,3 @@ /* @flow */ | ||
} from "@paypal/sdk-logos/src"; | ||
import type { ZalgoPromise } from "@krakenjs/zalgo-promise/src"; | ||
import { ZalgoPromise } from "@krakenjs/zalgo-promise/src"; | ||
@@ -54,2 +54,10 @@ import { | ||
function showAlert(message): ZalgoPromise<void> { | ||
return new ZalgoPromise((resolve) => { | ||
// eslint-disable-next-line no-alert | ||
window.alert(message); | ||
resolve(); | ||
}); | ||
} | ||
export function Overlay({ | ||
@@ -86,11 +94,12 @@ context, | ||
if (isIos()) { | ||
// eslint-disable-next-line no-alert | ||
window.alert("Please switch tabs to reactivate the PayPal window"); | ||
showAlert("Please switch tabs to reactivate the PayPal window").then(() => | ||
focus() | ||
); | ||
} else if (isFirefox()) { | ||
// eslint-disable-next-line no-alert | ||
window.alert( | ||
showAlert( | ||
'Don\'t see the popup window after clicking "OK"?\n\nSelect "Window" in your toolbar to find "Log in to your PayPal account"' | ||
); | ||
).then(() => focus()); | ||
} else { | ||
focus(); | ||
} | ||
focus(); | ||
} | ||
@@ -260,11 +269,12 @@ | ||
if (isIos()) { | ||
// eslint-disable-next-line no-alert | ||
window.alert("Please switch tabs to reactivate the Venmo window"); | ||
showAlert("Please switch tabs to reactivate the Venmo window").then(() => | ||
focus() | ||
); | ||
} else if (isFirefox()) { | ||
// eslint-disable-next-line no-alert | ||
window.alert( | ||
showAlert( | ||
'Don\'t see the popup window after clicking "OK"?\n\nSelect "Window" in your toolbar to find "Log in to your Venmo account"' | ||
); | ||
).then(() => focus()); | ||
} else { | ||
focus(); | ||
} | ||
focus(); | ||
} | ||
@@ -271,0 +281,0 @@ |
89806
1768