@codecademy/brand 2.4.0 → 2.4.1-alpha.78560defd9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +0 -0
- package/dist/Recurly/context/recurly/index.js +1 -1
- package/dist/Recurly/context/recurly/loadRecurly.d.ts +1 -1
- package/dist/Recurly/context/recurly/loadRecurly.js +2 -2
- package/dist/Recurly/context/recurly/w.d.ts +1 -1
- package/dist/Recurly/context/recurly/w.js +1 -1
- package/package.json +1 -1
|
File without changes
|
|
@@ -16,7 +16,7 @@ export function RecurlyProvider({
|
|
|
16
16
|
}) {
|
|
17
17
|
const [recurly, setRecurly] = useState(undefined);
|
|
18
18
|
useEffect(() => {
|
|
19
|
-
loadRecurly(config)
|
|
19
|
+
loadRecurly(config)?.then(setRecurly);
|
|
20
20
|
// Exclude `config` dependency as it should be treated as static.
|
|
21
21
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22
22
|
}, []);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { w } from './w';
|
|
2
2
|
export function loadRecurly(config) {
|
|
3
|
-
if (
|
|
3
|
+
if (w && w._recurlyPromise) {
|
|
4
4
|
w._recurlyPromise = new Promise(resolve => {
|
|
5
5
|
const script = w.document.createElement('script');
|
|
6
6
|
script.src = 'https://js.recurly.com/v4/recurly.js';
|
|
@@ -18,5 +18,5 @@ export function loadRecurly(config) {
|
|
|
18
18
|
w.document.head.appendChild(script);
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
return w
|
|
21
|
+
return w?._recurlyPromise;
|
|
22
22
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/brand",
|
|
3
3
|
"description": "Brand component library for Codecademy",
|
|
4
|
-
"version": "2.4.0",
|
|
4
|
+
"version": "2.4.1-alpha.78560defd9.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/is-prop-valid": "^1.2.1",
|