From 509fbd73e95288a86ee8ee87ff9668b7876df82b Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 4 Aug 2022 09:08:46 +0200 Subject: [PATCH] fix JS error, if user has no preferences or favorites --- api/js/etemplate/Et2Favorites/Et2Favorites.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Favorites/Et2Favorites.ts b/api/js/etemplate/Et2Favorites/Et2Favorites.ts index a96f63ac04..ecd16e6e27 100644 --- a/api/js/etemplate/Et2Favorites/Et2Favorites.ts +++ b/api/js/etemplate/Et2Favorites/Et2Favorites.ts @@ -103,7 +103,7 @@ export class Et2Favorites extends Et2DropdownButton implements et2_INextmatchHea public static readonly PREFIX = "favorite_"; protected static readonly ADD_VALUE = "~add~"; - private favSortedList : any = null; + private favSortedList : any = []; private _preferred : string; private _nextmatch : et2_nextmatch; @@ -203,6 +203,7 @@ export class Et2Favorites extends Et2DropdownButton implements et2_INextmatchHea }; // Load saved favorites + this.favSortedList = []; let preferences : any = this.egw().preference("*", app); for(let pref_name in preferences) {