Skip to content

Commit

Permalink
fix(MessageForwarder): use native browser navigation outside of Talk
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>

[skip ci]
  • Loading branch information
Antreesy authored and backportbot[bot] committed Feb 20, 2024
1 parent 57ffb18 commit d8f564f
Showing 1 changed file with 18 additions and 8 deletions.
Expand Up @@ -73,6 +73,7 @@ import cloneDeep from 'lodash/cloneDeep.js'
import Check from 'vue-material-design-icons/Check.vue'
import { showError } from '@nextcloud/dialogs'
import { generateUrl } from '@nextcloud/router'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
Expand Down Expand Up @@ -199,17 +200,26 @@ export default {
},
openConversation() {
if (window.location.href.includes('/apps/files')) {
// Native redirect to Talk from Files sidebar
const url = generateUrl('/call/{token}#message_{messageId}', {
token: this.selectedConversationToken,
messageId: this.forwardedMessageID,
})
window.open(url, '_blank').focus()
} else {
this.$router.push({
name: 'conversation',
hash: `#message_${this.forwardedMessageID}`,
params: {
token: `${this.selectedConversationToken}`,
},
}).catch(err => console.debug(`Error while pushing the new conversation's route: ${err}`))
}
this.$router.push({
name: 'conversation',
hash: `#message_${this.forwardedMessageID}`,
params: {
token: `${this.selectedConversationToken}`,
},
})
.catch(err => console.debug(`Error while pushing the new conversation's route: ${err}`))
this.showForwardedConfirmation = false
this.forwardedMessageID = ''
this.$emit('close')
},
handleClose() {
Expand Down

0 comments on commit d8f564f

Please sign in to comment.