Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #10819 from NejcZdovc/hotfix/#7032-hanger
Browse files Browse the repository at this point in the history
Fixes bookmark move location cache
  • Loading branch information
cezaraugusto authored Sep 15, 2017
2 parents de24d9e + dc49efa commit b47daf7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/common/state/bookmarksState.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,15 @@ const bookmarksState = {
: destinationItem.get('folderId')

state = bookmarkOrderCache.removeCacheKey(state, bookmark.get('parentFolderId'), bookmarkKey)
state = bookmarkLocationCache.removeCacheKey(state, bookmark.get('location'), bookmarkKey)

bookmark = bookmark.set('parentFolderId', ~~parentFolderId)
const newKey = bookmarkUtil.getKey(bookmark)

state = state.deleteIn([STATE_SITES.BOOKMARKS, bookmarkKey])
state = bookmarkOrderCache.addBookmarkToCache(state, bookmark.get('parentFolderId'), newKey)
state = bookmarkLocationCache.addCacheKey(state, bookmark.get('location'), newKey)

bookmark = bookmark.set('key', newKey)
return state.setIn([STATE_SITES.BOOKMARKS, newKey], bookmark)
}
Expand Down

0 comments on commit b47daf7

Please sign in to comment.