fix: handle lazy startup failures
This commit is contained in:
1 parent
84f87ce24e
commit
c80e9878de
5 files changed
+85
-21
No files matched your search
@@ -43,7 +43,11 @@ export const IntegrationMultiSelectGrid = ({
|
||||
[selectedKindsArray, onSelectionChange],
|
||||
);
|
||||
|
||||
const { data: integrations = [], isPending } = useQuery({
|
||||
const {
|
||||
data: integrations = [],
|
||||
isPending,
|
||||
isError,
|
||||
} = useQuery({
|
||||
queryKey: ["widget-integrations", { enableMockIntegration, onboarding }],
|
||||
queryFn: () => buildSortedIntegrations({ enableMockIntegration, onboarding }),
|
||||
});
|
||||
@@ -136,7 +140,14 @@ export const IntegrationMultiSelectGrid = ({
|
||||
);
|
||||
})}
|
||||
|
||||
{!isPending && filtered.length === 0 && (
|
||||
{isError && (
|
||||
<Center p="xl">
|
||||
<Text c="red" role="alert">
|
||||
{t("common.error")}
|
||||
</Text>
|
||||
</Center>
|
||||
)}
|
||||
{!isPending && !isError && filtered.length === 0 && (
|
||||
<Center p="xl">
|
||||
<Text c="dimmed">{t("common.noResults")}</Text>
|
||||
</Center>
|
||||
|
||||
@@ -20,7 +20,11 @@ export const IntegrationSelectGrid = ({ onSelect, enableMockIntegration = false
|
||||
const [search, setSearch] = useState("");
|
||||
const t = useI18n();
|
||||
|
||||
const { data: integrations = [], isPending } = useQuery({
|
||||
const {
|
||||
data: integrations = [],
|
||||
isPending,
|
||||
isError,
|
||||
} = useQuery({
|
||||
queryKey: ["widget-integrations", { enableMockIntegration }],
|
||||
queryFn: () => buildSortedIntegrations({ enableMockIntegration }),
|
||||
});
|
||||
@@ -89,7 +93,14 @@ export const IntegrationSelectGrid = ({ onSelect, enableMockIntegration = false
|
||||
</Card>
|
||||
))}
|
||||
|
||||
{!isPending && filtered.length === 0 && (
|
||||
{isError && (
|
||||
<Center p="xl">
|
||||
<Text c="red" role="alert">
|
||||
{t("common.error")}
|
||||
</Text>
|
||||
</Center>
|
||||
)}
|
||||
{!isPending && !isError && filtered.length === 0 && (
|
||||
<Center p="xl">
|
||||
<Text c="dimmed">{t("common.noResults")}</Text>
|
||||
</Center>
|
||||
|
||||
Reference in new issue
Block a user