Library popup_after_login_js is loaded in all pages, How to load this library just for the specific page?

/**
 * Hook_preprocess_page().
 */
function popup_after_login_preprocess_page(&$variables) {
  global $base_url;
  $variables['#attached']['library'][] = 'popup_after_login/popup_after_login_js';
  $variables['#attached']['drupalSettings']['siteBaseUrl'] = $base_url;
}
CommentFileSizeAuthor
#3 3100226-3.patch986 byteskeshavv

Comments

Riadh Rahmi created an issue. See original summary.

keshavv’s picture

Version: 8.x-2.0 » 10.0.x-dev
keshavv’s picture

Status: Active » Needs review
StatusFileSize
new986 bytes

Patch added.

  • keshav.k authored 4c10335e on 10.0.x
    Issue #3100226 by keshav.k: Library popup_after_login_js is loaded in...
keshavv’s picture

Status: Needs review » Fixed

Deployed to 10.0.x Branch.
Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.