Skip to content

Commit

Permalink
Fix issues with store switcher
Browse files Browse the repository at this point in the history
ISSUE CS-4764
  • Loading branch information
MarijaIv committed Oct 24, 2023
1 parent a61374f commit 3e0fdec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/views/css/adyen-core.css
Original file line number Diff line number Diff line change
Expand Up @@ -2796,10 +2796,12 @@ ul.adl-bullet-list li {
max-width: 90%;
flex-direction: column;
align-items: center;
position: relative;
position: fixed;
margin: 0 auto;
box-shadow: 0 8px 8px rgba(0, 17, 44, 0.04), 0 2px 4px rgba(0, 17, 44, 0.08);
border-radius: 12px;
top: 50vh;
transform: translateY(-50%);
}
#adl-page .adl-modal .adlp-modal-content .adlp-close-button {
position: absolute;
Expand Down
20 changes: 13 additions & 7 deletions src/views/js/StateController.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if (!window.AdyenFE) {
* @property {string} stateUrl
* @property {string} storesUrl
* @property {string} currentStoreUrl
* @property {string} switchContextUrl
* @property {string} connectionDetailsUrl
* @property {string} merchantsUrl
* @property {string} versionUrl
Expand Down Expand Up @@ -288,10 +289,15 @@ if (!window.AdyenFE) {
return Promise.resolve(true);
},
(storeId) => {
setStoreId(storeId);
window.location.hash = '';
this.enableSidebar();
this.display();
if (storeId !== getStoreId()) {
api.get(configuration.switchContextUrl.replace('{storeId}', storeId)).then(
/** @param {Store|Store[]} response */
(response) => {
setStoreId(storeId);
location.reload();
}
);
}
}
)
);
Expand Down Expand Up @@ -362,9 +368,9 @@ if (!window.AdyenFE) {
const container = templateService.getHeaderSection();
templateService.clearComponent(container);
enabled &&
container.append(
elementGenerator.createFlashMessage(['maintenance.title', 'maintenance.description'], 'warning')
);
container.append(
elementGenerator.createFlashMessage(['maintenance.title', 'maintenance.description'], 'warning')
);
};

/**
Expand Down

0 comments on commit 3e0fdec

Please sign in to comment.