Skip to content

Commit

Permalink
Merge pull request #366 from weni-ai/fix/room-update
Browse files Browse the repository at this point in the history
Added validation to request profile again and pass to take room
  • Loading branch information
Aldemylla authored Oct 25, 2023
2 parents d3f0d6f + 6be7592 commit 65857e8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/chats/chat/ModalGetChat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<script>
import { mapState } from 'vuex';
import Profile from '@/services/api/resources/profile';
import Room from '@/services/api/resources/chats/room';
export default {
Expand Down Expand Up @@ -55,8 +56,15 @@ export default {
async getChat() {
if (this.whenGetChat) this.whenGetChat();
let me = this.me.email;
await Room.take(this.room.uuid, this.me.email);
if (!me) {
const response = await Profile.me();
me = response.email;
this.$store.commit('profile/setMe', response);
}
await Room.take(this.room.uuid, me);
await this.setActiveRoom(this.room.uuid);
if (this.room.user) {
Room.updateReadMessages(this.room.uuid, true);
Expand Down

0 comments on commit 65857e8

Please sign in to comment.