Skip to content

Commit 7b64f39

Browse files
committed
fix(Linkwarden): Set Folder#isRoot
Signed-off-by: Marcel Klehr <[email protected]>
1 parent ec6e4d5 commit 7b64f39

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/adapters/Linkwarden.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,13 @@ export default class LinkwardenAdapter implements Adapter, IResource<typeof Item
196196
}))
197197
}
198198

199-
const buildTree = (collection) => {
199+
const buildTree = (collection, isRoot = false) => {
200200
return new Folder({
201201
id: collection.id,
202202
title: collection.name,
203203
parentId: collection.parentId,
204204
location: ItemLocation.SERVER,
205+
isRoot,
205206
children: collections
206207
.filter(col => col.parentId === collection.id)
207208
.map(buildTree).concat(
@@ -218,7 +219,7 @@ export default class LinkwardenAdapter implements Adapter, IResource<typeof Item
218219
})
219220
}
220221

221-
return buildTree(rootCollection)
222+
return buildTree(rootCollection, true)
222223
}
223224

224225
async isAvailable(): Promise<boolean> {
@@ -288,7 +289,7 @@ export default class LinkwardenAdapter implements Adapter, IResource<typeof Item
288289
if (res.status === 403) {
289290
throw new AuthenticationError()
290291
}
291-
if (res.status === 503 || res.status > 400) {
292+
if (res.status === 503 || res.status >= 400) {
292293
throw new HttpError(res.status, verb)
293294
}
294295
let json

0 commit comments

Comments
 (0)