Refactor history entry limits
This commit is contained in:
@@ -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 = []
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user