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>
  • Loading branch information
Antreesy committed Feb 19, 2024
1 parent c2847f4 commit 8f05d42
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
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 @@ -131,17 +132,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 8f05d42

Please sign in to comment.