fix: unhandled promise rejection in SearchableMultiSelect debounce
- Wrap onSearch call in .catch() to prevent Uncaught (in promise) errors - Add console.warn to DashboardHubModel.loadDashboardSearchOptions catch for debugging visibility
This commit is contained in:
@@ -62,7 +62,10 @@
|
||||
searchQuery = e.target.value;
|
||||
if (debounceMs > 0 && onSearch) {
|
||||
clearTimeout(debounceTimer);
|
||||
debounceTimer = setTimeout(() => onSearch(searchQuery), debounceMs);
|
||||
debounceTimer = setTimeout(() => {
|
||||
const result = onSearch(searchQuery);
|
||||
if (result instanceof Promise) result.catch(() => {});
|
||||
}, debounceMs);
|
||||
}
|
||||
if (!isOpen) isOpen = true;
|
||||
}
|
||||
|
||||
@@ -391,7 +391,10 @@ export class DashboardHubModel {
|
||||
id: d.id, name: d.title, subtitle: d.slug || '',
|
||||
hint: d.last_modified ? formatDate(d.last_modified) : '',
|
||||
}));
|
||||
} catch { this.searchableDashboardOptions = []; }
|
||||
} catch {
|
||||
this.searchableDashboardOptions = [];
|
||||
console.warn('[DashboardHub] loadDashboardSearchOptions failed');
|
||||
}
|
||||
finally { this.searchableDashboardLoading = false; }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user