fix: only show recent 50 synced history entries - fixed #1530

This commit is contained in:
Liyas Thomas
2021-03-12 17:35:16 +05:30
parent df3df6697e
commit 4d0008186b
2 changed files with 20851 additions and 11 deletions

View File

@@ -14,6 +14,9 @@ const firebaseConfig = {
measurementId: process.env.MEASUREMENT_ID || "G-ERJ6025CEB", measurementId: process.env.MEASUREMENT_ID || "G-ERJ6025CEB",
} }
const historyLimit = 50
const graphqlHistoryLimit = 50
export const authProviders = { export const authProviders = {
google: () => new firebase.auth.GoogleAuthProvider(), google: () => new firebase.auth.GoogleAuthProvider(),
github: () => new firebase.auth.GithubAuthProvider(), github: () => new firebase.auth.GithubAuthProvider(),
@@ -89,6 +92,7 @@ export class FirebaseInstance {
.doc(this.currentUser.uid) .doc(this.currentUser.uid)
.collection("history") .collection("history")
.orderBy("updatedOn", "desc") .orderBy("updatedOn", "desc")
.limit(historyLimit)
.onSnapshot((historyRef) => { .onSnapshot((historyRef) => {
const history = [] const history = []
historyRef.forEach((doc) => { historyRef.forEach((doc) => {
@@ -103,6 +107,7 @@ export class FirebaseInstance {
.doc(this.currentUser.uid) .doc(this.currentUser.uid)
.collection("graphqlHistory") .collection("graphqlHistory")
.orderBy("updatedOn", "desc") .orderBy("updatedOn", "desc")
.limit(graphqlHistoryLimit)
.onSnapshot((historyRef) => { .onSnapshot((historyRef) => {
const history = [] const history = []
historyRef.forEach((doc) => { historyRef.forEach((doc) => {

20857
package-lock.json generated

File diff suppressed because it is too large Load Diff