Skip to content

Commit

Permalink
fix(MessageForwader): provide value to check where component is being…
Browse files Browse the repository at this point in the history
… used

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Feb 25, 2024
1 parent 89e20d9 commit 33240dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

<script>
import debounce from 'debounce'
import { provide } from 'vue'
import PreventUnload from 'vue-prevent-unload'

import { getCurrentUser } from '@nextcloud/auth'
Expand Down Expand Up @@ -81,6 +82,9 @@ export default {
},

setup() {
// Add provided value to check if we're in the main app or plugin
provide('Talk:isMainApp', true)

return {
isInCall: useIsInCall(),
isLeavingAfterSessionIssue: useSessionIssueHandler(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@

<script>

import { inject } from 'vue'

import Check from 'vue-material-design-icons/Check.vue'

import { showError } from '@nextcloud/dialogs'
Expand Down Expand Up @@ -91,6 +93,12 @@ export default {

emits: ['close'],

setup() {
return {
isTalkMainApp: inject('Talk:isMainApp', false)
}
},

data() {
return {
selectedConversationToken: null,
Expand Down Expand Up @@ -132,9 +140,7 @@ export default {
},

openConversation() {
const isTalkApp = IS_DESKTOP || window.location.pathname.includes('/apps/spreed') || window.location.pathname.includes('/call/')

if (!isTalkApp) {
if (!this.isTalkMainApp) {
// Native redirect to Talk from Files sidebar
const url = generateUrl('/call/{token}#message_{messageId}', {
token: this.selectedConversationToken,
Expand Down

0 comments on commit 33240dc

Please sign in to comment.