Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 72a34a8

Browse files
committed
Move instantiation of firestore to prevent race-problems.
1 parent 2f5d602 commit 72a34a8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

firestore-element.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@
131131
super();
132132
this._firestoreProps = {};
133133
this._firestoreListeners = {};
134-
this.db = this.constructor.db || firebase.firestore();
135134
}
136135

137136
connectedCallback() {
137+
super.connectedCallback();
138+
this.db = this.constructor.db || firebase.firestore();
138139
const props = collect(this.constructor, 'properties');
139140
for (let name in props) {
140141
if (props[name].doc) {
@@ -143,7 +144,6 @@
143144
this._firestoreBind('collection', props[name].collection, name, props[name].live, props[name].observes);
144145
}
145146
}
146-
super.connectedCallback();
147147
}
148148

149149
_firestoreBind(type, path, name, live = false, observes = []) {
@@ -205,7 +205,7 @@
205205
delete this._firestoreListeners[name];
206206
}
207207
}
208-
}
209-
}
208+
};
209+
};
210210
})(window);
211211
</script>

0 commit comments

Comments
 (0)