@@ -285,9 +285,7 @@ export default {
285285 EventBus .$on (' should-refresh-conversations' , this .handleShouldRefreshConversations )
286286 EventBus .$once (' conversations-received' , this .handleUnreadMention )
287287 EventBus .$on (' route-change' , this .onRouteChange )
288- EventBus .$once (' joined-conversation' , ({ token }) => {
289- this .scrollToConversation (token)
290- })
288+ EventBus .$on (' joined-conversation' , this .handleJoinedConversation )
291289 this .mountArrowNavigation ()
292290 },
293291
@@ -406,10 +404,6 @@ export default {
406404 if (item .source === ' users' ) {
407405 // Create one-to-one conversation directly
408406 const conversation = await this .$store .dispatch (' createOneToOneConversation' , item .id )
409- this .abortSearch ()
410- EventBus .$once (' joined-conversation' , ({ token }) => {
411- this .scrollToConversation (token)
412- })
413407 this .$router .push ({
414408 name: ' conversation' ,
415409 params: { token: conversation .token },
@@ -586,6 +580,16 @@ export default {
586580 }
587581 },
588582
583+ handleJoinedConversation ({ token }) {
584+ this .abortSearch ()
585+ this .scrollToConversation (token)
586+ if (this .isMobile ) {
587+ emit (' toggle-navigation' , {
588+ open: false ,
589+ })
590+ }
591+ },
592+
589593 iconData (item ) {
590594 if (item .source === ' users' ) {
591595 return {
0 commit comments