Skip to content

Commit

Permalink
fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Sep 9, 2024
1 parent 312095e commit 71754e3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Tags/Livewire.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ public function assets(): void

$key = md5($html);

\Livewire\store($this->context['__livewire'])->push('assets', $html, $key);
if (in_array($key, \Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys)) {
// Skip it...
} else {
\Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys[] = $key;
\Livewire\store($this->context['__livewire'])->push('assets', $html, $key);
}
}

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

$key = md5($html);

if (in_array($key, \Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys)) {
// Skip it...
} else {
\Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys[] = $key;
\Livewire\store($this->context['__livewire'])->push('scripts', $html, $key);
}
\Livewire\store($this->context['__livewire'])->push('scripts', $html, $key);
}
}

0 comments on commit 71754e3

Please sign in to comment.