Browse Source
Merge pull request #5172 from nextcloud/bugfix/5144/js-error-when-posting-as-guest
Fix js error when posting as guest
pull/5178/head
Vincent Petry
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
13 additions and
7 deletions
-
src/components/NewMessageForm/NewMessageForm.vue
-
src/services/participantsService.js
-
src/store/messagesStore.js
|
|
|
@ -300,7 +300,7 @@ export default { |
|
|
|
clearTimeout(timeout) |
|
|
|
|
|
|
|
// If successful, deletes the temporary message from the store |
|
|
|
this.$store.dispatch('deleteMessage', temporaryMessage) |
|
|
|
this.$store.dispatch('removeTemporaryMessageFromStore', temporaryMessage) |
|
|
|
// And adds the complete version of the message received |
|
|
|
// by the server |
|
|
|
this.$store.dispatch('processMessage', response.data.ocs.data) |
|
|
|
|
|
|
|
@ -50,18 +50,14 @@ const joinConversation = async(token) => { |
|
|
|
force: forceJoin, |
|
|
|
}) |
|
|
|
|
|
|
|
const conversation = response.data.ocs.data |
|
|
|
if (conversation.actorType !== 'guests') { |
|
|
|
store.dispatch('addConversation', response.data.ocs.data) |
|
|
|
} |
|
|
|
|
|
|
|
// Update the participant and actor session after a force join
|
|
|
|
store.dispatch('setCurrentParticipant', response.data.ocs.data) |
|
|
|
store.dispatch('addConversation', response.data.ocs.data) |
|
|
|
store.dispatch('updateSessionId', { |
|
|
|
token: token, |
|
|
|
participantIdentifier: store.getters.getParticipantIdentifier(), |
|
|
|
sessionId: response.data.ocs.data.sessionId, |
|
|
|
}) |
|
|
|
store.dispatch('setCurrentParticipant', response.data.ocs.data) |
|
|
|
|
|
|
|
// FIXME Signaling should not be synchronous
|
|
|
|
await signalingJoinConversation(token, response.data.ocs.data.sessionId) |
|
|
|
|
|
|
|
@ -284,6 +284,16 @@ const actions = { |
|
|
|
context.commit('markTemporaryMessageAsFailed', { message, reason }) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* Remove temporary message from store after receiving the parsed one from server |
|
|
|
* |
|
|
|
* @param {object} context default store context; |
|
|
|
* @param {object} message the temporary message; |
|
|
|
*/ |
|
|
|
removeTemporaryMessageFromStore(context, message) { |
|
|
|
context.commit('deleteMessage', message) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* @param {object} context default store context; |
|
|
|
* @param {string} token Token of the conversation |
|
|
|
|