diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2023-06-07 18:53:00 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-06-08 16:20:40 +0000 |
commit | c2d4d18c88b9d8647ee67228d486542cba2fe226 (patch) | |
tree | f6b133c953f806851d63cc44e06c0783b6d5ffd3 /src | |
parent | 56942ca52f8505b167cf44ba967e7c70d9800a51 (diff) |
fix getter, move self-filtration to store
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/NewMessage/NewMessageTypingIndicator.vue | 5 | ||||
-rw-r--r-- | src/store/participantsStore.js | 15 | ||||
-rw-r--r-- | src/utils/SignalingTypingHandler.js | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/components/NewMessage/NewMessageTypingIndicator.vue b/src/components/NewMessage/NewMessageTypingIndicator.vue index 402e30987..c49a83d81 100644 --- a/src/components/NewMessage/NewMessageTypingIndicator.vue +++ b/src/components/NewMessage/NewMessageTypingIndicator.vue @@ -69,10 +69,7 @@ export default { }, typingParticipants() { - return this.$store.getters.participantsListTyping(this.token).filter(participant => { - return participant.actorType !== this.$store.getters.getActorType() - || participant.actorId !== this.$store.getters.getActorId() - }) + return this.$store.getters.participantsListTyping(this.token) }, visibleParticipants() { diff --git a/src/store/participantsStore.js b/src/store/participantsStore.js index 3f077ba43..b63ad6d28 100644 --- a/src/store/participantsStore.js +++ b/src/store/participantsStore.js @@ -105,9 +105,9 @@ const getters = { * @param {object} getters - the getters object. * @param {object} rootState - the rootState object. * @param {object} rootGetters - the rootGetters object. - * @return {Array} the typing session IDs array. + * @return {boolean} the typing status of actor. */ - actorIsTyping: (state, getters, rootState, rootGetters) => () => { + actorIsTyping: (state, getters, rootState, rootGetters) => { if (!state.typing[rootGetters.getToken()]) { return false } @@ -121,17 +121,20 @@ const getters = { * * @param {object} state - the state object. * @param {object} getters - the getters object. - * @return {Array} the participants array (if there are participants in the - * store). + * @param {object} rootState - the rootState object. + * @param {object} rootGetters - the rootGetters object. + * @return {Array} the participants array (for registered users only). */ - participantsListTyping: (state, getters) => (token) => { + participantsListTyping: (state, getters, rootState, rootGetters) => (token) => { if (!getters.externalTypingSignals(token).length) { return [] } - // Check if participant's sessionId matches with any of sessionIds from signaling return getters.participantsList(token).filter(attendee => { + // Check if participant's sessionId matches with any of sessionIds from signaling... return getters.externalTypingSignals(token).some((sessionId) => attendee.sessionIds.includes(sessionId)) + // ... and it's not the participant with same actorType and actorId as yourself + && (attendee.actorType !== rootGetters.getActorType() || attendee.actorId !== rootGetters.getActorId()) }) }, diff --git a/src/utils/SignalingTypingHandler.js b/src/utils/SignalingTypingHandler.js index cb7e4b046..0e27a23d2 100644 --- a/src/utils/SignalingTypingHandler.js +++ b/src/utils/SignalingTypingHandler.js @@ -128,7 +128,7 @@ SignalingTypingHandler.prototype = { }, _handleParticipantsJoined(SignalingParticipantList, participants) { - if (!this._store.getters.actorIsTyping()) { + if (!this._store.getters.actorIsTyping) { return } |