Skip to content

Commit

Permalink
Fixes upgrade of bookmark/folder width
Browse files Browse the repository at this point in the history
Resolves brave#9517
Resolves brave#9939

Auditors:

Test Plan:
  • Loading branch information
NejcZdovc committed Jan 22, 2018
1 parent a3b96a2 commit 956108e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions app/browser/reducers/bookmarkToolbarReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const Immutable = require('immutable')

// Constants
const appConstants = require('../../../js/constants/appConstants')

Expand All @@ -20,13 +22,18 @@ const bookmarkToolbarReducer = (state, action, immutableAction) => {
{
// update session for 0.21.x version
const bookmarks = bookmarksState.getBookmarks(state)
let list = Immutable.List()
if (bookmarks.first() && !bookmarks.first().has('width')) {
textCalc.calcTextList(bookmarks.toList())
list = bookmarks.toList()
}

const bookmarkFolders = bookmarkFoldersState.getFolders(state)
if (bookmarkFolders.first() && !bookmarkFolders.first().has('width')) {
textCalc.calcTextList(bookmarkFolders.toList())
list = list.concat(bookmarkFolders.toList())
}

if (!list.isEmpty()) {
textCalc.calcTextList(list)
}
}
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe('bookmarkToolbarReducer unit test', function () {
bookmarkToolbarReducer(stateWithData, {
actionType: appConstants.APP_SET_STATE
})
assert.equal(spyCalc.callCount, 2)
assert.equal(spyCalc.callCount, 1)
})

it('we are on version 0.21', function () {
Expand Down

0 comments on commit 956108e

Please sign in to comment.