Turn off react query subscription for user bets and portfolio history
This commit is contained in:
parent
0318f7a12b
commit
1d948821ca
|
@ -95,11 +95,7 @@ export const useUpdatedContracts = (contracts: Contract[] | undefined) => {
|
|||
export const useUserBetContracts = (userId: string) => {
|
||||
const result = useFirestoreQueryData(
|
||||
['contracts', 'bets', userId],
|
||||
getUserBetContractsQuery(userId),
|
||||
{ subscribe: true, includeMetadataChanges: true },
|
||||
// Temporary workaround for react-query bug:
|
||||
// https://github.com/invertase/react-query-firebase/issues/25
|
||||
{ refetchOnMount: 'always' }
|
||||
getUserBetContractsQuery(userId)
|
||||
)
|
||||
return result.data
|
||||
}
|
||||
|
|
|
@ -8,11 +8,7 @@ export const usePortfolioHistory = (userId: string, period: Period) => {
|
|||
|
||||
const result = useFirestoreQueryData(
|
||||
['portfolio-history', userId, cutoff],
|
||||
getPortfolioHistoryQuery(userId, cutoff),
|
||||
{ subscribe: true, includeMetadataChanges: true },
|
||||
// Temporary workaround for react-query bug:
|
||||
// https://github.com/invertase/react-query-firebase/issues/25
|
||||
{ refetchOnMount: 'always' }
|
||||
getPortfolioHistoryQuery(userId, cutoff)
|
||||
)
|
||||
return result.data
|
||||
}
|
||||
|
|
|
@ -9,11 +9,7 @@ import {
|
|||
export const useUserBets = (userId: string) => {
|
||||
const result = useFirestoreQueryData(
|
||||
['bets', userId],
|
||||
getUserBetsQuery(userId),
|
||||
{ subscribe: true, includeMetadataChanges: true },
|
||||
// Temporary workaround for react-query bug:
|
||||
// https://github.com/invertase/react-query-firebase/issues/25
|
||||
{ refetchOnMount: 'always' }
|
||||
getUserBetsQuery(userId)
|
||||
)
|
||||
return result.data
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user