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) => {
|
export const useUserBetContracts = (userId: string) => {
|
||||||
const result = useFirestoreQueryData(
|
const result = useFirestoreQueryData(
|
||||||
['contracts', 'bets', userId],
|
['contracts', 'bets', userId],
|
||||||
getUserBetContractsQuery(userId),
|
getUserBetContractsQuery(userId)
|
||||||
{ subscribe: true, includeMetadataChanges: true },
|
|
||||||
// Temporary workaround for react-query bug:
|
|
||||||
// https://github.com/invertase/react-query-firebase/issues/25
|
|
||||||
{ refetchOnMount: 'always' }
|
|
||||||
)
|
)
|
||||||
return result.data
|
return result.data
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,11 +8,7 @@ export const usePortfolioHistory = (userId: string, period: Period) => {
|
||||||
|
|
||||||
const result = useFirestoreQueryData(
|
const result = useFirestoreQueryData(
|
||||||
['portfolio-history', userId, cutoff],
|
['portfolio-history', userId, cutoff],
|
||||||
getPortfolioHistoryQuery(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' }
|
|
||||||
)
|
)
|
||||||
return result.data
|
return result.data
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,11 +9,7 @@ import {
|
||||||
export const useUserBets = (userId: string) => {
|
export const useUserBets = (userId: string) => {
|
||||||
const result = useFirestoreQueryData(
|
const result = useFirestoreQueryData(
|
||||||
['bets', userId],
|
['bets', userId],
|
||||||
getUserBetsQuery(userId),
|
getUserBetsQuery(userId)
|
||||||
{ subscribe: true, includeMetadataChanges: true },
|
|
||||||
// Temporary workaround for react-query bug:
|
|
||||||
// https://github.com/invertase/react-query-firebase/issues/25
|
|
||||||
{ refetchOnMount: 'always' }
|
|
||||||
)
|
)
|
||||||
return result.data
|
return result.data
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user