Refactor alias filter select component to prevent automatic reset of selected alias
- Updated logic in the alias filter select component to avoid resetting the selected alias to "all" during loading when the available aliases may be temporarily empty. - Ensured that the selected value defaults to "all" only if no value is provided.
This commit is contained in:
@@ -14,12 +14,10 @@
|
||||
} = $props();
|
||||
|
||||
$effect(() => {
|
||||
if ((value ?? "all") !== "all" && !availableAliases.includes(value ?? "all")) {
|
||||
value = "all";
|
||||
}
|
||||
if (!value) {
|
||||
value = "all";
|
||||
}
|
||||
// Не сбрасываем выбранный alias автоматически:
|
||||
// во время загрузки список может быть временно пустым, что
|
||||
// приводило к возврату на "all" сразу после выбора.
|
||||
if (!value) value = "all";
|
||||
});
|
||||
|
||||
let selectedLabel = $derived((value ?? "all") === "all" ? allLabel : (value ?? "all"));
|
||||
|
||||
Reference in New Issue
Block a user