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",
}
const historyLimit = 50
const graphqlHistoryLimit = 50
export const authProviders = {
google: () => new firebase.auth.GoogleAuthProvider(),
github: () => new firebase.auth.GithubAuthProvider(),
@@ -89,6 +92,7 @@ export class FirebaseInstance {
.doc(this.currentUser.uid)
.collection("history")
.orderBy("updatedOn", "desc")
.limit(historyLimit)
.onSnapshot((historyRef) => {
const history = []
historyRef.forEach((doc) => {
@@ -103,6 +107,7 @@ export class FirebaseInstance {
.doc(this.currentUser.uid)
.collection("graphqlHistory")
.orderBy("updatedOn", "desc")
.limit(graphqlHistoryLimit)
.onSnapshot((historyRef) => {
const history = []
historyRef.forEach((doc) => {