Skip to content

Commit

Permalink
enh: modify display mode update for owner
Browse files Browse the repository at this point in the history
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
  • Loading branch information
enjeck committed Oct 3, 2024
1 parent f86f424 commit 2006e21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/modules/modals/EditContext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@
<NcContextResource :resources.sync="resources" :receivers.sync="receivers" />
</div>
<div class="row space-T">
<NcActions>
<NcActionCheckbox :checked="showInNavigationDefault" @change="updateDisplayMode">
Show in app list
</NcActionCheckbox>
</NcActions>
<NcActionCheckbox :checked="showInNavigationDefault" @change="updateDisplayMode">
Show in app list
</NcActionCheckbox>
<p class="nav-display-subtext">
This can be overridden by a per-account preference
</p>
Expand Down
6 changes: 5 additions & 1 deletion src/modules/navigation/partials/NavigationContextItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,13 @@ export default {
},
updateDisplayMode() {
const value = !this.showInNavigation
let displayMode = value ? NAV_ENTRY_MODE.NAV_ENTRY_MODE_RECIPIENTS : NAV_ENTRY_MODE.NAV_ENTRY_MODE_HIDDEN
if (this.ownsContext(this.context)) {
displayMode = value ? NAV_ENTRY_MODE.NAV_ENTRY_MODE_ALL : NAV_ENTRY_MODE.NAV_ENTRY_MODE_HIDDEN
}
const share = Object.values(this.context.sharing || {}).find(share => share.receiver === getCurrentUser().uid)
if (share) {
this.$store.dispatch('updateDisplayMode', { shareId: share.share_id, displayMode: value ? NAV_ENTRY_MODE.NAV_ENTRY_MODE_RECIPIENTS : NAV_ENTRY_MODE.NAV_ENTRY_MODE_HIDDEN, target: 'self' })
this.$store.dispatch('updateDisplayMode', { shareId: share.share_id, displayMode, target: 'self' })
this.showInNavigation = value
}
},
Expand Down

0 comments on commit 2006e21

Please sign in to comment.