Skip to content

Commit

Permalink
Fix reactivity in mobile shares nav
Browse files Browse the repository at this point in the history
Implicit generated key wasn't incorporating the `active` state and thus
didn't force a re-render when the active state changed.
  • Loading branch information
kulmann committed Mar 11, 2022
1 parent 19acb5e commit b9f508a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<oc-list>
<li v-for="navItem in navItems" :key="`shares-navigation-mobile-${navItem.to}`">
<oc-button
:key="`shares-nav-${navItem.to.name}-${navItem.active ? 'active' : 'inactive'}`"
type="router-link"
class="oc-my-xs shares-nav-mobile"
appearance="raw"
Expand All @@ -45,8 +46,7 @@ import {
locationSharesWithMe,
locationSharesWithOthers
} from '../../router/shares'
import { useActiveLocation } from '../../composables'
import { computed, getCurrentInstance, unref } from '@vue/composition-api'
import { computed, getCurrentInstance } from '@vue/composition-api'
import { useRouter } from 'web-pkg/src/composables'
export default {
Expand All @@ -66,19 +66,19 @@ export default {
icon: 'share-forward',
to: sharesRoutes[locationSharesWithMe.name].path,
text: $gettext('Shared with me'),
active: unref(useActiveLocation(isLocationSharesActive, locationSharesWithMe.name))
active: isLocationSharesActive(router, 'files-shares-with-me')
},
{
icon: 'reply',
to: sharesRoutes[locationSharesWithOthers.name].path,
text: $gettext('Shared with others'),
active: unref(useActiveLocation(isLocationSharesActive, locationSharesWithOthers.name))
active: isLocationSharesActive(router, 'files-shares-with-others')
},
{
icon: 'link',
to: sharesRoutes[locationSharesViaLink.name].path,
text: $gettext('Shared via link'),
active: unref(useActiveLocation(isLocationSharesActive, locationSharesViaLink.name))
active: isLocationSharesActive(router, 'files-shares-via-link')
}
])
return {
Expand Down

0 comments on commit b9f508a

Please sign in to comment.