Skip to content

Commit b55f53e

Browse files
committed
fix(NextcloudBookmarks): Fix checkFeatureJavascriptLinks
page param starts at 0 Signed-off-by: Marcel Klehr <[email protected]>
1 parent aeb1f73 commit b55f53e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/adapters/NextcloudBookmarks.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,13 +770,14 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
770770
try {
771771
const json = await this.sendRequest(
772772
'GET',
773-
`index.php/apps/bookmarks/public/rest/v2/bookmark?page=1&limit=1`
773+
`index.php/apps/bookmarks/public/rest/v2/bookmark?page=0&limit=1`
774774
)
775775
if (!json.data.length) {
776776
this.hasFeatureJavascriptLinks = true
777777
try {
778-
const id = await this.createBookmark(new Bookmark({id: null, parentId: '-1', title: 'floccus', url: 'javascript:void(0)', location: ItemLocation.SERVER}))
779-
await this.removeBookmark(new Bookmark({id, parentId: '-1', title: 'floccus', url: 'javascript:void(0)', location: ItemLocation.SERVER}))
778+
const url = `javascript:void(${Math.random()})`
779+
const id = await this.createBookmark(new Bookmark({id: null, parentId: '-1', title: 'floccus', url, location: ItemLocation.SERVER}))
780+
await this.removeBookmark(new Bookmark({id, parentId: '-1', title: 'floccus', url, location: ItemLocation.SERVER}))
780781
} catch (e) {
781782
this.hasFeatureJavascriptLinks = false
782783
}

0 commit comments

Comments
 (0)