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, setRESTHistoryEntries,
graphqlHistoryStore, graphqlHistoryStore,
setGraphqlHistoryEntries, setGraphqlHistoryEntries,
HISTORY_LIMIT,
} from "~/newstore/history" } from "~/newstore/history"
// Initialize Firebase, copied from cloud console // Initialize Firebase, copied from cloud console
@@ -22,9 +23,6 @@ const firebaseConfig = {
measurementId: process.env.MEASUREMENT_ID, measurementId: process.env.MEASUREMENT_ID,
} }
const HISTORY_LIMIT = 50
const GQL_HISTORY_LIMIT = 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(),
@@ -197,7 +195,7 @@ export class FirebaseInstance {
.doc(this.currentUser.uid) .doc(this.currentUser.uid)
.collection("graphqlHistory") .collection("graphqlHistory")
.orderBy("updatedOn", "desc") .orderBy("updatedOn", "desc")
.limit(GQL_HISTORY_LIMIT) .limit(HISTORY_LIMIT)
.onSnapshot((historyRef) => { .onSnapshot((historyRef) => {
const history = [] const history = []

View File

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