Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nx/utils/ims.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export async function loadIms(loginPopup) {
window.adobeid.modalMode = true;
window.adobeid.modalSettings = { allowedOrigin: window.location.origin };
}
loadScript(IMS_URL);
loadScript(IMS_URL, 'high');
});
return imsDetails;
}
3 changes: 2 additions & 1 deletion nx/utils/script.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export default async function loadScript(src) {
export default async function loadScript(src, priority) {
return new Promise((resolve, reject) => {
if (!document.querySelector(`head > script[src="${src}"]`)) {
const script = document.createElement('script');
if (priority) script.fetchPriority = priority;
script.src = src;
script.onload = resolve;
script.onerror = reject;
Expand Down
5 changes: 3 additions & 2 deletions nx2/utils/ims.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ export function handleSignOut() {
window.adobeIMS.signOut();
}

async function loadScript(src) {
async function loadScript(src, priority) {
return new Promise((resolve, reject) => {
if (!document.querySelector(`head > script[src="${src}"]`)) {
const script = document.createElement('script');
if (priority) script.fetchPriority = priority;
script.src = src;
script.onload = resolve;
script.onerror = reject;
Expand Down Expand Up @@ -118,7 +119,7 @@ export const loadIms = (() => {
},
onError: reject,
};
loadScript(IMS_URL);
loadScript(IMS_URL, 'high');
});

return () => {
Expand Down
Loading