Skip to content

Commit 6a33aa8

Browse files
Prevent duplicate assets
1 parent 55d55ac commit 6a33aa8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Assets.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function addStylesDirectly($assets)
107107
{
108108
foreach ((array)$assets as &$item) {
109109
if (!in_array($item, $this->appendedStyles)) {
110-
$this->appendedStyles[] = [
110+
$this->appendedStyles[$item] = [
111111
'src' => $item,
112112
'attributes' => [],
113113
];
@@ -128,7 +128,7 @@ public function addScriptsDirectly($assets, $location = self::ASSETS_SCRIPT_POSI
128128
{
129129
foreach ((array)$assets as &$item) {
130130
if (!in_array($item, $this->appendedScripts[$location])) {
131-
$this->appendedScripts[$location][] = [
131+
$this->appendedScripts[$location][$item] = [
132132
'src' => $item,
133133
'attributes' => [],
134134
];

0 commit comments

Comments
 (0)