Skip to content

Commit

Permalink
feat: add auto open room logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuseduardomedeiros committed Dec 26, 2024
1 parent 62027b0 commit 641bb37
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/views/Dashboard/ViewMode/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ export default {
}),
computed: {
...mapState(useRooms, { room: (store) => store.activeRoom }),
...mapState(useRooms, {
room: (store) => store.activeRoom,
rooms: (store) => store.rooms,
}),
...mapState(useDiscussions, {
discussion: (store) => store.activeDiscussion,
}),
Expand All @@ -134,6 +137,19 @@ export default {
}
},
},
rooms: {
once: true,
async handler() {
const { room_uuid } = this.$route.query;
if (room_uuid) {
const activeRoom = this.rooms.find((room) => room.uuid === room_uuid);
if (activeRoom) await this.setActiveRoom(activeRoom);
this.$router.replace({ query: {} });
}
},
},
},
beforeMount() {
Expand Down

0 comments on commit 641bb37

Please sign in to comment.