Skip the swatch levels when the picker draws nothing

Without profiles the component renders nothing, so it should not read the scheme
file once per contrast level first.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
Andreas Reinhold / reini
2026-09-14 05:41:14 +02:00
co-authored by Claude Fable 5.1
parent 6aa8a48084
commit 4ba28b8579
@@ -36,7 +36,7 @@
// colours — so the binding below never asks whether a level is there. // colours — so the binding below never asks whether a level is there.
$swatches = []; $swatches = [];
foreach (\NoNameWeb\LivewireMaterial\Support\Scheme::LEVELS as $level) { foreach ($profiles === [] ? [] : \NoNameWeb\LivewireMaterial\Support\Scheme::LEVELS as $level) {
$generated = $level === 'standard' ? [] : \NoNameWeb\LivewireMaterial\Support\Scheme::profiles(contrast: $level); $generated = $level === 'standard' ? [] : \NoNameWeb\LivewireMaterial\Support\Scheme::profiles(contrast: $level);
foreach ($profiles as $profile => $scheme) { foreach ($profiles as $profile => $scheme) {