Refactor history entry limits

This commit is contained in:
Andrew Bastin
2021-05-24 22:13:50 -04:00
parent fcac750ad7
commit 46ebd49936
2 changed files with 3 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ import {
setRESTHistoryEntries,
graphqlHistoryStore,
setGraphqlHistoryEntries,
HISTORY_LIMIT,
} from "~/newstore/history"
// Initialize Firebase, copied from cloud console
@@ -22,9 +23,6 @@ const firebaseConfig = {
measurementId: process.env.MEASUREMENT_ID,
}
const HISTORY_LIMIT = 50
const GQL_HISTORY_LIMIT = 50
export const authProviders = {
google: () => new firebase.auth.GoogleAuthProvider(),
github: () => new firebase.auth.GithubAuthProvider(),
@@ -197,7 +195,7 @@ export class FirebaseInstance {
.doc(this.currentUser.uid)
.collection("graphqlHistory")
.orderBy("updatedOn", "desc")
.limit(GQL_HISTORY_LIMIT)
.limit(HISTORY_LIMIT)
.onSnapshot((historyRef) => {
const history = []

View File

@@ -10,7 +10,7 @@ export const defaultGraphqlHistoryState = {
state: [] as any[],
}
const HISTORY_LIMIT = 50
export const HISTORY_LIMIT = 50
type RESTHistoryType = typeof defaultRESTHistoryState
type GraphqlHistoryType = typeof defaultGraphqlHistoryState