Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(MessageForwader): provide value to check where component is being used #11650

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading