mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-10 00:03:24 +00:00
Use reduce instead of groupBy for user picture sorting to support more browsers
This commit is contained in:
parent
68d0a16d1c
commit
d95d4901d2
@ -87,7 +87,13 @@
|
|||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
this.pictures = await this.get_pictures();
|
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;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user