From 6ea9d16f87597bbefc5f618058b83570bd246f4f Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Fri, 4 Jun 2021 22:52:06 -0400 Subject: [PATCH] Add firebase sync code for new environment state system --- helpers/fb.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helpers/fb.js b/helpers/fb.js index 730e25857..d0adde190 100644 --- a/helpers/fb.js +++ b/helpers/fb.js @@ -46,7 +46,6 @@ export class FirebaseInstance { this.idToken = null this.currentFeeds = [] this.currentSettings = [] - this.currentEnvironments = [] this.currentUser$ = new ReplaySubject(1) this.idToken$ = new ReplaySubject(1) @@ -56,7 +55,7 @@ export class FirebaseInstance { let loadedGraphqlHistory = false let loadedRESTCollections = false let loadedGraphqlCollections = false - const loadedEnvironments = false + let loadedEnvironments = false graphqlCollectionStore.subject$.subscribe(({ state }) => { if ( @@ -300,9 +299,10 @@ export class FirebaseInstance { environment.id = doc.id environments.push(environment) }) - if (environments.length > 0) { - this.currentEnvironments = environments[0].environment - } + + loadedEnvironments = false + replaceEnvironments(environments) + loadedEnvironments = true }) } else { this.currentUser = null