apps/web: close message on click
This commit is contained in:
parent
62043e84f3
commit
a679b0b6c6
@ -41,6 +41,7 @@ export const PolicyTable = observer(
|
||||
content: 'Выбранный расчет ЭЛТ применен',
|
||||
duration: 1,
|
||||
key: record.key,
|
||||
onClick: () => message.destroy(record.key),
|
||||
});
|
||||
$process.delete('ELT');
|
||||
}
|
||||
|
||||
@ -61,6 +61,8 @@ const httpLink = new HttpLink({
|
||||
uri: URL_CRM_GRAPHQL,
|
||||
});
|
||||
|
||||
const key = 'APOLLO_GRAPHQL';
|
||||
|
||||
const errorLink = onError(({ graphQLErrors, networkError, operation, response }) => {
|
||||
const scope = getCurrentScope();
|
||||
scope.setTag('operationName', operation.operationName);
|
||||
@ -68,7 +70,8 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, response })
|
||||
if (!isServer()) {
|
||||
message.error({
|
||||
content: `Ошибка во время загрузки данных из CRM`,
|
||||
key: 'APOLLO_GRAPHQL',
|
||||
key,
|
||||
onClick: () => message.destroy(key),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ export function common({ store, trpcClient, apolloClient }: ProcessContext) {
|
||||
message.loading({
|
||||
content: `Загружаем КП ${quote?.label}...`,
|
||||
key,
|
||||
onClick: () => message.destroy(key),
|
||||
});
|
||||
|
||||
const eltInitialValues = await initElt();
|
||||
@ -90,12 +91,14 @@ export function common({ store, trpcClient, apolloClient }: ProcessContext) {
|
||||
message.success({
|
||||
content: `КП ${quote.label} загружено`,
|
||||
key,
|
||||
onClick: () => message.destroy(key),
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
message.error({
|
||||
content: `Ошибка во время загрузки КП ${quote.label}`,
|
||||
key,
|
||||
onClick: () => message.destroy(key),
|
||||
});
|
||||
$calculation.element('selectQuote').resetValue();
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user