@@ -424,25 +424,24 @@ class FastSearchCard extends HTMLElement {
424424
425425 console.log('π DEBUG: set hass called');
426426 console.log('π DEBUG: oldHass exists:', !!oldHass);
427- console.log('π DEBUG: user is admin:', hass.user?.is_admin);
428- console.log('π DEBUG: user info:', hass.user);
429-
430- // NEU: Auto-Setup beim ersten Start (nur fΓΌr Admins)
431- if (!oldHass && hass && hass.user?.is_admin) {
432- console.log('π DEBUG: Taking ADMIN path');
433- this.autoCreateUserLabels().then(() => {
427+ console.log('π DEBUG: favoritesLoaded:', this.favoritesLoaded);
428+
429+ // NEU: Favoriten laden wenn noch nicht geladen
430+ if (!this.favoritesLoaded) {
431+ console.log('π DEBUG: Loading favorites (not loaded yet)');
432+ if (hass.user?.is_admin) {
433+ this.autoCreateUserLabels().then(() => {
434+ this.loadAllFavorites().then(() => {
435+ this.updateItems();
436+ });
437+ });
438+ } else {
434439 this.loadAllFavorites().then(() => {
435440 this.updateItems();
436441 });
437- });
438- } else if (!oldHass && hass) {
439- console.log('π DEBUG: Taking NORMAL USER path');
440- // Normaler User - nur Favoriten laden
441- this.loadAllFavorites().then(() => {
442- this.updateItems();
443- });
442+ }
444443 } else {
445- console.log('π DEBUG: Taking ELSE path (no favorites loading)');
444+ // Favoriten bereits geladen, normale Updates
446445 const shouldUpdateAll = !oldHass || this.shouldUpdateItems(oldHass, hass);
447446 if (shouldUpdateAll) {
448447 this.updateItems();
0 commit comments