Skip to content

Commit

Permalink
Correctly fall back when default permissions are used
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Nov 25, 2021
1 parent 6a095b0 commit 4d6b2a2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/PermissionsEditor/PermissionsEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ export default {
})
} else throw Error('you need to fill either the conversationName or the displayName props')
},

permissionsWithDefault() {
if (this.permissions !== PERMISSIONS.DEFAULT) {
return this.permissions
}

return PERMISSIONS.MAX_DEFAULT & ~PERMISSIONS.LOBBY_IGNORE
},

/**
* The number of the edited permissions during the editing of the form.
* We use this to compare it with the actual permissions of the
Expand All @@ -167,12 +176,12 @@ export default {
* disabled.
*/
submitButtonDisabled() {
return this.permissions === this.formPermissions
return this.permissionsWithDefault === this.formPermissions
},
},

mounted() {
this.writePermissionsToComponent(this.permissions)
this.writePermissionsToComponent(this.permissionsWithDefault)
},

methods: {
Expand Down

0 comments on commit 4d6b2a2

Please sign in to comment.