Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-10-22 10:53:48 +0300
committerJoas Schilling <coding@schilljs.com>2021-10-22 10:53:48 +0300
commitcda771c8f02ef1c6a5fb828d18772ba2fc20838d (patch)
treea403f4e126e57857815f8d2a12571827f54eef20 /src/store
parent40caf331092c9dd5d23f1365d7fb4f0768d06b50 (diff)
Live update the store so the icon changes
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'src/store')
-rw-r--r--src/store/participantsStore.js34
1 files changed, 7 insertions, 27 deletions
diff --git a/src/store/participantsStore.js b/src/store/participantsStore.js
index 62c829970..e1bafc5dc 100644
--- a/src/store/participantsStore.js
+++ b/src/store/participantsStore.js
@@ -240,32 +240,6 @@ const mutations = {
Vue.delete(state.peers, token)
}
},
-
- addPermissions(state, { token, attendeeId, permissions }) {
- if (state.attendees[token] && state.attendees[token][attendeeId]) {
- const PREVIOUS_PERMISSIONS = state.attendees[token][attendeeId].permissions
- Vue.set(state.attendees[token][attendeeId], 'permissions', PREVIOUS_PERMISSIONS | permissions)
- } else {
- console.error('Error while updating the participant')
- }
- },
-
- removePermissions(state, { token, attendeeId, permissions }) {
- if (state.attendees[token] && state.attendees[token][attendeeId]) {
- const PREVIOUS_PERMISSIONS = state.attendees[token][attendeeId].permissions
- Vue.set(state.attendees[token][attendeeId], 'permissions', PREVIOUS_PERMISSIONS & ~permissions)
- } else {
- console.error('Error while updating the participant')
- }
- },
-
- setPermissions(state, { token, attendeeId, permissions }) {
- if (state.attendees[token] && state.attendees[token][attendeeId]) {
- Vue.set(state.attendees[token][attendeeId], 'permissions', permissions)
- } else {
- console.error('Error while updating the participant')
- }
- },
}
const actions = {
@@ -592,6 +566,7 @@ const actions = {
await grantAllPermissionsToParticipant(token, attendeeId)
const updatedData = {
permissions: PARTICIPANT.PERMISSIONS.MAX_CUSTOM,
+ attendeePermissions: PARTICIPANT.PERMISSIONS.MAX_CUSTOM,
}
context.commit('updateParticipant', { token, attendeeId, updatedData })
},
@@ -608,6 +583,7 @@ const actions = {
await removeAllPermissionsFromParticipant(token, attendeeId)
const updatedData = {
permissions: PARTICIPANT.PERMISSIONS.CUSTOM,
+ attendeePermissions: PARTICIPANT.PERMISSIONS.CUSTOM,
}
context.commit('updateParticipant', { token, attendeeId, updatedData })
},
@@ -624,7 +600,11 @@ const actions = {
*/
async setPermissions(context, { token, attendeeId, permissions }) {
await setPermissions(token, attendeeId, permissions)
- context.commit('setPermissions', { token, attendeeId, permissions })
+ const updatedData = {
+ permissions,
+ attendeePermissions: permissions,
+ }
+ context.commit('updateParticipant', { token, attendeeId, updatedData })
},
}