You are here

function nodejs_watchdog_page_attachments_alter in Node.js integration 8

Implements hook_page_attachments_alter().

File

nodejs_watchdog/nodejs_watchdog.module, line 6

Code

function nodejs_watchdog_page_attachments_alter(array &$attachments) {
  $route_name = \Drupal::service('current_route_match')
    ->getRouteName();
  if ($route_name == 'dblog.overview') {
    nodejs_send_content_channel_token('watchdog_dblog');
    $attachments['#attached']['library'][] = 'nodejs_watchdog/nodejs_watchdog';
  }
}