You are here

public function GatsbyPreview::isConfigured in Gatsby Live Preview & Incremental Builds 2.0.x

Same name and namespace in other branches
  1. 8 src/GatsbyPreview.php \Drupal\gatsby\GatsbyPreview::isConfigured()

Returns true if a preview server or build server URL is configured.

Return value

bool If a build or preview URL is configured.

File

src/GatsbyPreview.php, line 150

Class

GatsbyPreview
Defines a class for generating Gatsby based previews.

Namespace

Drupal\gatsby

Code

public function isConfigured() {
  $settings = $this->configFactory
    ->get('gatsby.settings');
  $preview_url = $settings
    ->get('preview_callback_url');
  $incrementalbuild_url = $settings
    ->get('incrementalbuild_url');
  if ($preview_url || $incrementalbuild_url) {
    return TRUE;
  }
  return FALSE;
}