Skip to content

Commit

Permalink
Fix console output
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Aug 20, 2024
1 parent e0363b4 commit 8dc409c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes for Sprig Core

## 3.4.1 - 2024-08-20

### Fixed

- Fixed a bug that was breaking the `Sprig` variable in the browser console with `devMode` enabled.

## 3.4.0 - 2024-08-20

### Changed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "putyourlightson/craft-sprig-core",
"description": "A reactive Twig component framework for Craft.",
"version": "3.4.0",
"version": "3.4.1",
"type": "craft-module",
"license": "mit",
"require": {
Expand Down
5 changes: 2 additions & 3 deletions src/helpers/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use craft\helpers\Json;
use putyourlightson\sprig\base\Component;
use putyourlightson\sprig\models\ConfigModel;
use putyourlightson\sprig\Sprig;

/**
* Manages the Sprig object in the console.
Expand All @@ -34,7 +33,7 @@ public static function init(): void

self::$initialised = true;

Sprig::$core->requests->registerJs('Sprig = {components: []}');
Component::registerJs('Sprig = {components: []}');
}

/**
Expand All @@ -50,6 +49,6 @@ public static function addComponent(ConfigModel $config): void

$value = Json::encode($config->getAttributes());

Sprig::$core->requests->registerJs('Sprig.components.push(' . $value . ')');
Component::registerJs('Sprig.components.push(' . $value . ')');
}
}

0 comments on commit 8dc409c

Please sign in to comment.