Merge pull request #598 from LeonKohli/main
Fix bookmark import issue with missing folder names
This commit is contained in:
commit
54beb50576
|
@ -63,11 +63,21 @@ async function processBookmarks(
|
||||||
) as Element;
|
) as Element;
|
||||||
|
|
||||||
if (collectionName) {
|
if (collectionName) {
|
||||||
|
const collectionNameContent = (collectionName.children[0] as TextNode)?.content;
|
||||||
|
if (collectionNameContent) {
|
||||||
collectionId = await createCollection(
|
collectionId = await createCollection(
|
||||||
userId,
|
userId,
|
||||||
(collectionName.children[0] as TextNode).content,
|
collectionNameContent,
|
||||||
parentCollectionId
|
parentCollectionId
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
// Handle the case when the collection name is empty
|
||||||
|
collectionId = await createCollection(
|
||||||
|
userId,
|
||||||
|
"Untitled Collection",
|
||||||
|
parentCollectionId
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await processBookmarks(
|
await processBookmarks(
|
||||||
userId,
|
userId,
|
||||||
|
@ -264,3 +274,4 @@ function processNodes(nodes: Node[]) {
|
||||||
nodes.forEach(findAndProcessDL);
|
nodes.forEach(findAndProcessDL);
|
||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ŝarĝante…
Reference in New Issue