fix(trading): ignore conditions list empty (#4848)
This commit is contained in:
parent
775835c667
commit
b818e9b2a1
@ -29,4 +29,8 @@ const hasNotFoundGraphQLErrors = (errors: GraphQLErrors, path?: string[]) => {
|
||||
};
|
||||
|
||||
export const marketDataErrorPolicyGuard = (errors: GraphQLErrors) =>
|
||||
errors.every((e) => e.message.match(/no market data for market:/i));
|
||||
errors.every(
|
||||
(e) =>
|
||||
e.message.match(/no market data for market:/i) ||
|
||||
e.message.match(/Conditions list is empty/)
|
||||
);
|
||||
|
@ -1,6 +1,7 @@
|
||||
import {
|
||||
makeDataProvider,
|
||||
makeDerivedDataProvider,
|
||||
marketDataErrorPolicyGuard,
|
||||
} from '@vegaprotocol/data-provider';
|
||||
import type {
|
||||
MarketInfoQuery,
|
||||
@ -30,6 +31,7 @@ export const marketInfoProvider = makeDataProvider<
|
||||
>({
|
||||
query: MarketInfoDocument,
|
||||
getData,
|
||||
errorPolicyGuard: marketDataErrorPolicyGuard,
|
||||
});
|
||||
|
||||
export const marketInfoWithDataProvider = makeDerivedDataProvider<
|
||||
|
@ -2,6 +2,7 @@ import { useYesterday } from '@vegaprotocol/react-helpers';
|
||||
import {
|
||||
makeDataProvider,
|
||||
makeDerivedDataProvider,
|
||||
marketDataErrorPolicyGuard,
|
||||
useDataProvider,
|
||||
} from '@vegaprotocol/data-provider';
|
||||
import type {
|
||||
@ -43,6 +44,7 @@ export const marketsProvider = makeDataProvider<
|
||||
query: MarketsDocument,
|
||||
getData,
|
||||
fetchPolicy: 'cache-first',
|
||||
errorPolicyGuard: marketDataErrorPolicyGuard,
|
||||
});
|
||||
|
||||
export const marketsMapProvider = makeDerivedDataProvider<
|
||||
|
Loading…
Reference in New Issue
Block a user