Skip to content

Commit

Permalink
fix(Linkwarden): Ignore bookmarks with url = null
Browse files Browse the repository at this point in the history
fixes #1788

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Dec 4, 2024
1 parent 9785c42 commit 90edb00
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/lib/strategies/Default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,21 @@ export default class SyncProcess {
}

filterOutInvalidBookmarks(tree: Folder<TItemLocation>): void {
if (this.isFirefox) {
tree.children = tree.children.filter(child => {
if (child instanceof Bookmark) {
return !child.url.startsWith('chrome')
} else {
this.filterOutInvalidBookmarks(child)
return true
tree.children = tree.children.filter(child => {
if (child instanceof Bookmark) {
// Chrome URLs cannot be added in firefox
if (this.isFirefox && child.url.startsWith('chrome')) {
return false
}
})
}
// Linkwarden supports bookmarks that have no URL eg. for directly uploaded files
if (child.url === null) {
return false
}
} else {
this.filterOutInvalidBookmarks(child)
}
return true
})
}

async filterOutDuplicatesInTheSameFolder(tree: Folder<TItemLocation>): Promise<void> {
Expand Down

0 comments on commit 90edb00

Please sign in to comment.