Skip to content

Commit 39c9d38

Browse files
committed
fix importer
1 parent 05115bf commit 39c9d38

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

apps/web/app/(ee)/api/cron/import/short/utils.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,16 @@ export const importLinksFromShort = async ({
144144
links: linksToCreate.map(({ tags, ...rest }) => {
145145
return {
146146
...rest,
147-
...(importTags && {
148-
tagIds: tags
149-
.map(
150-
(tag: string) => allTags.find((t) => t.name === tag)?.id ?? null,
151-
)
152-
.filter(Boolean),
153-
}),
147+
...(importTags &&
148+
Array.isArray(tags) &&
149+
tags.length > 0 && {
150+
tagIds: tags
151+
.map(
152+
(tag: string) =>
153+
allTags.find((t) => t.name === tag)?.id ?? null,
154+
)
155+
.filter(Boolean),
156+
}),
154157
};
155158
}),
156159
skipRedisCache: true,

apps/web/ui/modals/import-short-modal.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,9 @@ function ImportShortModal({
206206
<div className="flex flex-col items-center justify-center gap-2">
207207
<ServerOff className="h-6 w-6 text-neutral-500" />
208208
<p className="max-w-md text-center text-sm text-neutral-500">
209-
We weren't able to retrieve any links from your Short.io
210-
account.
209+
Unfortunately, Short.io has been blocking our servers in
210+
production. Please reach out to support and we'll help you
211+
import your links.
211212
</p>
212213
<a
213214
href="mailto:support@dub.co?subject=I%20need%20help%20with%20importing%20my%20Short.io%20links"

0 commit comments

Comments
 (0)