From a1f0df3a69e59f3939e20049599dde683c3433ad Mon Sep 17 00:00:00 2001 From: IlyaDoronin Date: Thu, 2 May 2024 11:43:10 +0300 Subject: [PATCH] fix: handle error --- src/pages/Tariffs/Tariffs.tsx | 6 +++++- src/ui_kit/CheckFastlink.tsx | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/Tariffs/Tariffs.tsx b/src/pages/Tariffs/Tariffs.tsx index eba9f78a..2fc36e8b 100644 --- a/src/pages/Tariffs/Tariffs.tsx +++ b/src/pages/Tariffs/Tariffs.tsx @@ -190,7 +190,11 @@ function TariffPage() { return; } - const [discounts] = await getDiscounts(userId); + const [discounts, discountsError] = await getDiscounts(userId); + + if (discountsError) { + throw new Error(discountsError); + } if (discounts?.length) { setDiscounts(discounts); diff --git a/src/ui_kit/CheckFastlink.tsx b/src/ui_kit/CheckFastlink.tsx index 1b38eee5..b54aa09f 100644 --- a/src/ui_kit/CheckFastlink.tsx +++ b/src/ui_kit/CheckFastlink.tsx @@ -29,6 +29,7 @@ export function CheckFastlink() { setDiscounts(discounts); } }; + get(); }, []);