Skip to content

Commit

Permalink
fix: setting livereload from config.php did not work
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Nov 6, 2023
1 parent 823d2f6 commit 6efdf9d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ public function init()
{
$this->wire->classLoader->addNamespace("RockFrontend", __DIR__ . "/classes");

// if settings are set in config.php we make sure to use these settings
$config = $this->wire->config;
if ($config->livereloadBackend !== null) {
$this->livereloadBackend = $config->livereloadBackend;
}

$this->path = $this->wire->config->paths($this);
$this->home = $this->wire->pages->get(1);

Expand Down Expand Up @@ -321,7 +327,7 @@ private function addLiveReloadScript()
// this is because live reload will break the module installation screen for example
if ($page->template == 'admin') {
// if livereload is disabled on backend pages we exit early
if (!$this->liveReloadBackend) return;
if (!$this->livereloadBackend) return;

// on module config screens we disable livereload if it is not explicitly
// forced to be enabled. this is to prevent problems when downloading
Expand Down Expand Up @@ -2367,9 +2373,9 @@ private function configLivereload(InputfieldWrapper $inputfields)

$fs->add([
'type' => 'checkbox',
'name' => 'liveReloadBackend',
'name' => 'livereloadBackend',
'label' => 'Add livereload to backend pages',
'checked' => $this->liveReloadBackend ? 'checked' : '',
'checked' => $this->livereloadBackend ? 'checked' : '',
'columnWidth' => 50,
'notes' => 'Really handy when working with RockMigrations!',
]);
Expand Down

0 comments on commit 6efdf9d

Please sign in to comment.