aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/settings
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/components/dashboard/settings')
-rw-r--r--apps/web/components/dashboard/settings/ImportExport.tsx20
1 files changed, 13 insertions, 7 deletions
diff --git a/apps/web/components/dashboard/settings/ImportExport.tsx b/apps/web/components/dashboard/settings/ImportExport.tsx
index f3ef13ef..1145a42d 100644
--- a/apps/web/components/dashboard/settings/ImportExport.tsx
+++ b/apps/web/components/dashboard/settings/ImportExport.tsx
@@ -64,14 +64,20 @@ export function ImportExportRow() {
listId: string;
}) => {
const bookmark = toImport.bookmark;
- if (bookmark.url === undefined) {
- throw new Error("URL is undefined");
+ if (bookmark.content === undefined) {
+ throw new Error("Content is undefined");
}
- new URL(bookmark.url);
- const created = await createBookmark({
- type: BookmarkTypes.LINK,
- url: bookmark.url,
- });
+ const created = await createBookmark(
+ bookmark.content.type === BookmarkTypes.LINK
+ ? {
+ type: BookmarkTypes.LINK,
+ url: bookmark.content.url,
+ }
+ : {
+ type: BookmarkTypes.TEXT,
+ text: bookmark.content.text,
+ },
+ );
await Promise.all([
// Update title and createdAt if they're set