Skip to content
This repository was archived by the owner on Jan 27, 2025. It is now read-only.

Commit 71754e3

Browse files
committed
fix logic
1 parent 312095e commit 71754e3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Tags/Livewire.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ public function assets(): void
9898

9999
$key = md5($html);
100100

101-
\Livewire\store($this->context['__livewire'])->push('assets', $html, $key);
101+
if (in_array($key, \Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys)) {
102+
// Skip it...
103+
} else {
104+
\Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys[] = $key;
105+
\Livewire\store($this->context['__livewire'])->push('assets', $html, $key);
106+
}
102107
}
103108

104109
/**
@@ -112,11 +117,6 @@ public function script(): void
112117

113118
$key = md5($html);
114119

115-
if (in_array($key, \Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys)) {
116-
// Skip it...
117-
} else {
118-
\Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys[] = $key;
119-
\Livewire\store($this->context['__livewire'])->push('scripts', $html, $key);
120-
}
120+
\Livewire\store($this->context['__livewire'])->push('scripts', $html, $key);
121121
}
122122
}

0 commit comments

Comments
 (0)