fix: app that dont require setup page (#11628)

* fix

* add new test
This commit is contained in:
alannnc authored and GitHub committed 2023-10-01 11:45:27 -03:00
1 parent caf1b4c5d7
commit 032435fbd4
3 files changed
+37 -2

No files matched your search

+1 -1
View File
@@ -116,7 +116,7 @@ export default function AppCard({
{app?.isInstalled && switchChecked && <hr className="border-subtle" />}
{app?.isInstalled && switchChecked ? (
app.isSetupAlready ? (
app.isSetupAlready === undefined || app.isSetupAlready ? (
<div className="relative p-4 pt-5 text-sm [&_input]:mb-0 [&_input]:leading-4">
<Link href={`/apps/${app.slug}/setup`} className="absolute right-4 top-4">
<Settings className="text-default h-4 w-4" aria-hidden="true" />
@@ -166,7 +166,8 @@ export const integrationsHandler = async ({ ctx, input }: IntegrationsOptions) =
};
// We need to know if app is payment type
let isSetupAlready = false;
// undefined it means that app don't require app/setup/page
let isSetupAlready = undefined;
if (credential && app.categories.includes("payment")) {
const paymentApp = (await appStore[app.dirName as keyof typeof appStore]()) as PaymentApp | null;
if (paymentApp && "lib" in paymentApp && paymentApp?.lib && "PaymentService" in paymentApp?.lib) {