From d95d4901d200bcbe69815437024208d2f3356b10 Mon Sep 17 00:00:00 2001 From: Sli Date: Tue, 27 Aug 2024 10:35:38 +0200 Subject: [PATCH] Use reduce instead of groupBy for user picture sorting to support more browsers --- core/templates/core/user_pictures.jinja | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/templates/core/user_pictures.jinja b/core/templates/core/user_pictures.jinja index bd5f1d44..68c7a53c 100644 --- a/core/templates/core/user_pictures.jinja +++ b/core/templates/core/user_pictures.jinja @@ -87,7 +87,13 @@ async init() { this.pictures = await this.get_pictures(); - this.albums = Object.groupBy(this.pictures, ({album}) => album); + this.albums = this.pictures.reduce((acc, picture) => { + if (!acc[picture.album]){ + acc[picture.album] = []; + } + acc[picture.album].push(picture); + return acc; + }, {}); this.loading = false; },