Skip to content

Commit

Permalink
fix: new separator always added to default location (close #44)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddy-gustiaux committed Apr 30, 2019
1 parent e8ceeb2 commit 5609cae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/background/bookmarking/BuiltinBookmarking.js
Expand Up @@ -72,6 +72,7 @@ class BuiltinBookmarking {

async move(id, bookmarkInfo) {
if (!this._isSystemCreated(bookmarkInfo)) return;
if (Utils.bookmarkIsSeparator(bookmarkInfo)) return;
let bookmarkTreeNode;
if (Utils.bookmarkIsWebPage(bookmarkInfo)) {
bookmarkTreeNode = this._createMovingPropertiesForBookmark();
Expand Down
12 changes: 12 additions & 0 deletions src/background/utils/Utils.js
Expand Up @@ -64,6 +64,18 @@ class Utils {
// BOOKMARKS
// -------------------------------------------------------------------------------------------------

// Indicate if a bookmark object is a separator
static bookmarkIsSeparator(bookmarkInfo) {
let isSeparator = false;
if (
Object.prototype.hasOwnProperty.call(bookmarkInfo, 'type') &&
bookmarkInfo.type === 'separator'
) {
isSeparator = true;
}
return isSeparator;
}

// Indicate if a bookmark object is a web page
static bookmarkIsWebPage(bookmarkInfo) {
let isWebPage = false;
Expand Down

0 comments on commit 5609cae

Please sign in to comment.