Skip to content

Commit

Permalink
Merge pull request #4430 from owncloud/copy-nav-item-state
Browse files Browse the repository at this point in the history
Copy nav item state
  • Loading branch information
fschade authored Dec 8, 2020
2 parents 111569d + ecc99fe commit 8d1c7ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-nav-item-state
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Copy dynamicNavItems state

The dynamicNavItems state in ADD_NAV_ITEM mutation now gets copied instead of referenced to trigger a state change.

https://github.com/owncloud/ocis/issues/1031
https://github.com/owncloud/phoenix/pull/4430
2 changes: 1 addition & 1 deletion src/store/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const mutations = {
* @constructor
*/
ADD_NAV_ITEM(state, { extension, navItem }) {
const dynamicNavItems = state.dynamicNavItems
const dynamicNavItems = { ...state.dynamicNavItems }
dynamicNavItems[extension] = dynamicNavItems[extension] || []
const index = dynamicNavItems[extension].findIndex(item => item.name === navItem.name)
if (index >= 0) {
Expand Down

0 comments on commit 8d1c7ef

Please sign in to comment.