Skip to content
Snippets Groups Projects
Commit 451f08a5 authored by utkarsh_33's avatar utkarsh_33 Committed by Chris Wells
Browse files

Issue #3504665 by utkarsh_33, phenaproxima, chrisfromredfin: Clicking...

Issue #3504665 by utkarsh_33, phenaproxima, chrisfromredfin: Clicking "install" button with empty queue shows message multiple times
parent 916e54b1
No related branches found
No related tags found
1 merge request!711#3504665: Clicking "install" button with empty queue shows message multiple times
Pipeline #418231 canceled
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -203,7 +203,17 @@ export const processInstallList = async () => { ...@@ -203,7 +203,17 @@ export const processInstallList = async () => {
const projectsToActivate = []; const projectsToActivate = [];
const projectsToDownloadAndActivate = []; const projectsToDownloadAndActivate = [];
if (currentInstallList.length === 0) { if (currentInstallList.length === 0) {
new Drupal.Message().add(Drupal.t('No projects selected'), { type: 'error' }); const messageElement = document.querySelector('[data-drupal-message-id="install_message"]');
if (!messageElement) {
// If the message does not exist, create a new one.
new Drupal.Message().add(Drupal.t('No projects selected'), { type: 'error', id: 'install_message' });
} else if (messageElement.classList.contains('visually-hidden')) {
// If the message exists but is visually hidden, remove the class and reset opacity.
messageElement.classList.remove('visually-hidden');
messageElement.style.opacity = 1;
}
window.scrollTo({ top: 0, behavior: 'smooth' }); window.scrollTo({ top: 0, behavior: 'smooth' });
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment