Skip to content
This repository was archived by the owner on Jan 26, 2021. It is now read-only.

Commit 6e1b05b

Browse files
committed
Add check to not delete all the bookmarks
1 parent e38cc8d commit 6e1b05b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ function whenReady(callback) {
6464
function syncBookmarks(ownCloudBookmarks, group) {
6565
// Remove bookmarks
6666
search({ group: group }).on("end", function (results) {
67-
save(remove(results)).on("end", function () {
67+
var oldBookmarks = results.filter(function (item) {
68+
return item.type == "bookmark" && item.group == group;
69+
});
70+
save(remove(oldBookmarks)).on("end", function () {
6871
// Add bookmarks
6972
let bookmarks = [];
7073
ownCloudBookmarks.forEach(function (ownCloudBookmark) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "ownCloud Bookmarks",
33
"name": "owncloud-bookmarks",
4-
"version": "0.0.1",
4+
"version": "0.0.2",
55
"description": "Add-on for syncing bookmarks with ownCloud.",
66
"main": "index.js",
77
"author": "Martin Janser",

0 commit comments

Comments
 (0)