@ -376,7 +376,7 @@ export default {
}
} )
const beforeRouteChangeListener = ( to , from , next ) => {
const beforeRouteChangeListener = async ( to , from , next ) => {
if ( this . isNextcloudTalkHashDirty ) {
/ / N e x t c l o u d T a l k c o n f i g u r a t i o n c h a n g e d , r e l o a d t h e p a g e w h e n c h a n g i n g c o n f i g u r a t i o n
window . location = generateUrl ( 'call/' + to . params . token )
@ -387,6 +387,15 @@ export default {
* This runs whenever the new route is a conversation .
* /
if ( to . name === 'conversation' ) {
/ / F e t c h c o n v e r s a t i o n o b j e c t , i f i t ' s n o t k n o w n y e t t o t h e c l i e n t
if ( ! this . $store . getters . conversation ( to . params . token ) ) {
const result = await this . fetchSingleConversation ( to . params . token )
if ( ! result ) {
/ / I f t h e c o n v e r s a t i o n i s n o t f o u n d , b l o c k f u r t h e r n a v i g a t i o n ,
/ / i t i s h a n d l e d i n t h e f e t c h S i n g l e C o n v e r s a t i o n m e t h o d
return
}
}
/ / U p d a t e c u r r e n t t o k e n i n t h e t o k e n s t o r e
this . $store . dispatch ( 'updateToken' , to . params . token )
}
@ -596,13 +605,13 @@ export default {
return
}
this . isRefreshingCurrentConversation = true
let isSuccessfullyFetched = false
try {
/ * *
* Fetches a single conversation
* /
await this . $store . dispatch ( 'fetchConversation' , { token } )
isSuccessfullyFetched = true
/ * *
* Emits a global event that is used in App . vue to update the page title once the
* ( if the current route is a conversation and once the conversations are received )
@ -617,6 +626,7 @@ export default {
} finally {
this . isRefreshingCurrentConversation = false
}
return isSuccessfullyFetched
} ,
/ / U p o n p r e s s i n g C t r l + F , f o c u s S e a r c h B o x n a t i v e i n p u t i n t h e L e f t S i d e b a r