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.

fix importer

Steven Tey39c9d3805c28
diff --git a/apps/web/app/(ee)/api/cron/import/short/utils.ts b/apps/web/app/(ee)/api/cron/import/short/utils.ts
index 428dfab794..05275f55bd 100644
--- a/apps/web/app/(ee)/api/cron/import/short/utils.ts
+++ b/apps/web/app/(ee)/api/cron/import/short/utils.ts
@@ -144,13 +144,16 @@ export const importLinksFromShort = async ({
links: linksToCreate.map(({ tags, ...rest }) => {
return {
...rest,
- ...(importTags && {
- tagIds: tags
- .map(
- (tag: string) => allTags.find((t) => t.name === tag)?.id ?? null,
- )
- .filter(Boolean),
- }),
+ ...(importTags &&
+ Array.isArray(tags) &&
+ tags.length > 0 && {
+ tagIds: tags
+ .map(
+ (tag: string) =>
+ allTags.find((t) => t.name === tag)?.id ?? null,
+ )
+ .filter(Boolean),
+ }),
};
}),
skipRedisCache: true,
diff --git a/apps/web/ui/modals/import-short-modal.tsx b/apps/web/ui/modals/import-short-modal.tsx
index 09825a2d25..45a7edd430 100644
--- a/apps/web/ui/modals/import-short-modal.tsx
+++ b/apps/web/ui/modals/import-short-modal.tsx
@@ -206,8 +206,9 @@ function ImportShortModal({
<div className="flex flex-col items-center justify-center gap-2">
<ServerOff className="h-6 w-6 text-neutral-500" />
<p className="max-w-md text-center text-sm text-neutral-500">
- We weren't able to retrieve any links from your Short.io
- account.
+ Unfortunately, Short.io has been blocking our servers in
+ production. Please reach out to support and we'll help you
+ import your links.
</p>
<a
href="mailto:[email protected]?subject=I%20need%20help%20with%20importing%20my%20Short.io%20links"