fix/convertion-icon-clear-data
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
let allItems = $state<UnitOfMeasure[]>([]); // Store full dataset
|
||||
let loading = $state(false);
|
||||
let searchTerm = $state("");
|
||||
let wasOpen = $state(false);
|
||||
|
||||
// Derived state for filtering
|
||||
$effect(() => {
|
||||
@@ -34,11 +35,15 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Cargar datos al abrir
|
||||
// Cargar datos al abrir y resetear búsqueda cada vez que se abre
|
||||
$effect(() => {
|
||||
if (open && companyStore.activeCompany && allItems.length === 0) {
|
||||
loadData();
|
||||
if (open && !wasOpen) {
|
||||
searchTerm = "";
|
||||
if (companyStore.activeCompany && allItems.length === 0) {
|
||||
loadData();
|
||||
}
|
||||
}
|
||||
wasOpen = open;
|
||||
});
|
||||
|
||||
async function loadData() {
|
||||
|
||||
Reference in New Issue
Block a user