Skip to content

Commit fdb9afe

Browse files
committed
enh: modify display mode update for owner
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
1 parent ef29cf6 commit fdb9afe

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/modules/modals/EditContext.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@
3939
<NcContextResource :resources.sync="resources" :receivers.sync="receivers" />
4040
</div>
4141
<div class="row space-T">
42-
<NcActions>
43-
<NcActionCheckbox :checked="showInNavigationDefault" @change="updateDisplayMode">
44-
Show in app list
45-
</NcActionCheckbox>
46-
</NcActions>
42+
<NcActionCheckbox :checked="showInNavigationDefault" @change="updateDisplayMode">
43+
Show in app list
44+
</NcActionCheckbox>
4745
<p class="nav-display-subtext">
4846
This can be overridden by a per-account preference
4947
</p>

src/modules/navigation/partials/NavigationContextItem.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ export default {
117117
},
118118
updateDisplayMode() {
119119
const value = !this.showInNavigation
120+
let displayMode = value ? NAV_ENTRY_MODE.NAV_ENTRY_MODE_RECIPIENTS : NAV_ENTRY_MODE.NAV_ENTRY_MODE_HIDDEN
121+
if (this.ownsContext(this.context)) {
122+
displayMode = value ? NAV_ENTRY_MODE.NAV_ENTRY_MODE_ALL : NAV_ENTRY_MODE.NAV_ENTRY_MODE_HIDDEN
123+
}
120124
const share = Object.values(this.context.sharing || {}).find(share => share.receiver === getCurrentUser().uid)
121125
if (share) {
122-
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' })
126+
this.$store.dispatch('updateDisplayMode', { shareId: share.share_id, displayMode, target: 'self' })
123127
this.showInNavigation = value
124128
}
125129
},

0 commit comments

Comments
 (0)