From 53ca0616014faa8b72b193bb2243a5c6a0d7f3b9 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Tue, 24 May 2022 23:42:03 +0200 Subject: [PATCH] Fixes bug --- src/WebBrain.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/WebBrain.ts b/src/WebBrain.ts index 42931bb..b56a85c 100644 --- a/src/WebBrain.ts +++ b/src/WebBrain.ts @@ -31,7 +31,7 @@ export class WebBrain extends LitElement { @property({ type: Object }) user: User | null = null; - @property({type: Object}) persons : Map = new Map(); + @property({type: Array}) persons : Array<[string, IPerson]> = []; public firebaseApp: FirebaseApp; @@ -58,12 +58,11 @@ export class WebBrain extends LitElement { }); const unsub = onSnapshot(this.peopleCollection, (querySnapshot) => { - // const cities = []; + const tempPersons : Array<[string, IPerson]> = [] querySnapshot.forEach((doc) => { - this.persons.set(doc.id, doc.data() as IPerson); + tempPersons.push([doc.id, doc.data() as IPerson]); }); - this.requestUpdate(); - console.log('plop'); + this.persons = tempPersons }); } @@ -155,8 +154,8 @@ export class WebBrain extends LitElement {

The content will come here