Skip to content

Commit eac6d98

Browse files
committed
(UX) improve responsive behaviour
1 parent fef0488 commit eac6d98

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ChatWindow/ChatWindow.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default {
108108
if (this.roomId) {
109109
const room = newVal.find(r => r.roomId === this.roomId)
110110
this.fetchRoom({ room })
111-
} else {
111+
} else if (!this.isMobile) {
112112
this.fetchRoom({ room: this.orderedRooms[0] })
113113
}
114114
}
@@ -144,7 +144,9 @@ export default {
144144
145145
mounted() {
146146
this.updateResponsive()
147-
window.addEventListener('resize', () => this.updateResponsive())
147+
window.addEventListener('resize', ev => {
148+
if (ev.isTrusted) this.updateResponsive()
149+
})
148150
},
149151
150152
computed: {
@@ -180,7 +182,6 @@ export default {
180182
methods: {
181183
updateResponsive() {
182184
this.isMobile = window.innerWidth < this.responsiveBreakpoint
183-
this.showRoomsList = !this.isMobile
184185
},
185186
toggleRoomsList() {
186187
this.showRoomsList = !this.showRoomsList

0 commit comments

Comments
 (0)