Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

code improvements

Pedro Ladeira1a9392b68e32
diff --git a/apps/web/lib/ai/generate-reward.ts b/apps/web/lib/ai/generate-reward.ts
index 60377b74e0..38d1e03f7b 100644
--- a/apps/web/lib/ai/generate-reward.ts
+++ b/apps/web/lib/ai/generate-reward.ts
@@ -300,6 +300,17 @@ export async function generateReward(input: z.infer<typeof inputSchema>) {
}
}
+ if (
+ !parsed.data.supported &&
+ parsed.data.unavailableSource &&
+ !unavailableSources.some(
+ ({ id, missingIntegration }) =>
+ id === parsed.data.unavailableSource && missingIntegration,
+ )
+ ) {
+ stream.update({ ...parsed.data, unavailableSource: null });
+ }
+
stream.done();
} catch (error) {
await fail(error);