Skip to content

Commit 4a955cc

Browse files
committed
(fix) reset room when opening rooms list on mobile
1 parent 8e3a2b5 commit 4a955cc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ChatWindow/ChatWindow.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
:textMessages="t"
2626
:showRoomsList="showRoomsList"
2727
:isMobile="isMobile"
28-
@toggleRoomsList="showRoomsList = !showRoomsList"
28+
@toggleRoomsList="toggleRoomsList"
2929
@fetchMessages="fetchMessages"
3030
@sendMessage="sendMessage"
3131
@editMessage="editMessage"
@@ -134,6 +134,10 @@ export default {
134134
this.isMobile = window.innerWidth < this.mobileBreakpoint
135135
this.showRoomsList = !this.isMobile
136136
},
137+
toggleRoomsList() {
138+
this.showRoomsList = !this.showRoomsList
139+
if (this.isMobile) this.room = {}
140+
},
137141
fetchRoom({ room }) {
138142
this.room = room
139143
this.fetchMessages({ reset: true })

0 commit comments

Comments
 (0)