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

[stable27] refactor: make browserCheck an util #11136

Merged
merged 3 commits into from
Dec 7, 2023
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
6 changes: 2 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ import SettingsDialog from './components/SettingsDialog/SettingsDialog.vue'

import { useIsInCall } from './composables/useIsInCall.js'
import { CONVERSATION, PARTICIPANT } from './constants.js'
import browserCheck from './mixins/browserCheck.js'
import participant from './mixins/participant.js'
import sessionIssueHandler from './mixins/sessionIssueHandler.js'
import talkHashCheck from './mixins/talkHashCheck.js'
import Router from './router/router.js'
import BrowserStorage from './services/BrowserStorage.js'
import { EventBus } from './services/EventBus.js'
import { leaveConversationSync } from './services/participantsService.js'
import { checkBrowser } from './utils/browserCheck.js'
import { signalingKill } from './utils/webrtc/index.js'

// Styles
Expand All @@ -83,7 +83,6 @@ export default {
},

mixins: [
browserCheck,
talkHashCheck,
sessionIssueHandler,
participant,
Expand Down Expand Up @@ -462,8 +461,7 @@ export default {

async mounted() {
if (!IS_DESKTOP) {
// see browserCheck mixin
this.checkBrowser()
checkBrowser()
}
// Check sidebar status in previous sessions
if (BrowserStorage.getItem('sidebarOpen') === 'false') {
Expand Down
6 changes: 2 additions & 4 deletions src/FilesSidebarTabApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'

import LoadingComponent from './components/LoadingComponent.vue'

import browserCheck from './mixins/browserCheck.js'
import sessionIssueHandler from './mixins/sessionIssueHandler.js'
import { EventBus } from './services/EventBus.js'
import { getFileConversation } from './services/filesIntegrationServices.js'
import {
leaveConversationSync,
} from './services/participantsService.js'
import { checkBrowser } from './utils/browserCheck.js'
import CancelableRequest from './utils/cancelableRequest.js'
import { signalingKill } from './utils/webrtc/index.js'

Expand All @@ -80,7 +80,6 @@ export default {
},

mixins: [
browserCheck,
sessionIssueHandler,
],

Expand Down Expand Up @@ -174,8 +173,7 @@ export default {

methods: {
async joinConversation() {
// see browserCheck mixin
this.checkBrowser()
checkBrowser()

try {
await this.getFileConversation()
Expand Down
9 changes: 2 additions & 7 deletions src/PublicShareAuthRequestPasswordButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<script>
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'

import browserCheck from './mixins/browserCheck.js'
import { getPublicShareAuthConversationToken } from './services/publicShareAuthService.js'
import { checkBrowser } from './utils/browserCheck.js'

// Styles
import '@nextcloud/dialogs/dist/index.css'
Expand All @@ -55,10 +55,6 @@ export default {
NcButton,
},

mixins: [
browserCheck,
],

props: {
shareToken: {
type: String,
Expand Down Expand Up @@ -92,8 +88,7 @@ export default {

methods: {
async requestPassword() {
// see browserCheck mixin
this.checkBrowser()
checkBrowser()

this.hasRequestFailed = false
this.isRequestLoading = true
Expand Down
6 changes: 2 additions & 4 deletions src/PublicShareSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ import TopBar from './components/TopBar/TopBar.vue'
import TransitionWrapper from './components/TransitionWrapper.vue'

import { useIsInCall } from './composables/useIsInCall.js'
import browserCheck from './mixins/browserCheck.js'
import participant from './mixins/participant.js'
import sessionIssueHandler from './mixins/sessionIssueHandler.js'
import talkHashCheck from './mixins/talkHashCheck.js'
Expand All @@ -77,6 +76,7 @@ import { getPublicShareConversationData } from './services/filesIntegrationServi
import {
leaveConversationSync,
} from './services/participantsService.js'
import { checkBrowser } from './utils/browserCheck.js'
import { signalingKill } from './utils/webrtc/index.js'

// Styles
Expand All @@ -98,7 +98,6 @@ export default {
},

mixins: [
browserCheck,
sessionIssueHandler,
participant,
talkHashCheck,
Expand Down Expand Up @@ -162,8 +161,7 @@ export default {
methods: {

async joinConversation() {
// see browserCheck mixin
this.checkBrowser()
checkBrowser()

this.joiningConversation = true

Expand Down
16 changes: 13 additions & 3 deletions src/components/TopBar/CallButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
autoHide: false,
html: true
}"
:disabled="startCallButtonDisabled || loading || blockCalls"
:disabled="startCallButtonDisabled || loading"
:type="startCallButtonType"
@click="handleClick">
<template #icon>
Expand Down Expand Up @@ -96,11 +96,11 @@ import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'

import { useIsInCall } from '../../composables/useIsInCall.js'
import { CALL, CONVERSATION, PARTICIPANT } from '../../constants.js'
import browserCheck from '../../mixins/browserCheck.js'
import isInLobby from '../../mixins/isInLobby.js'
import participant from '../../mixins/participant.js'
import BrowserStorage from '../../services/BrowserStorage.js'
import { EventBus } from '../../services/EventBus.js'
import { blockCalls, unsupportedWarning } from '../../utils/browserCheck.js'

export default {
name: 'CallButton',
Expand All @@ -120,7 +120,6 @@ export default {
},

mixins: [
browserCheck,
isInLobby,
participant,
],
Expand Down Expand Up @@ -203,6 +202,7 @@ export default {
|| this.conversation.readOnly
|| this.isNextcloudTalkHashDirty
|| !this.currentConversationIsJoined
|| blockCalls
},

leaveCallLabel() {
Expand Down Expand Up @@ -270,6 +270,16 @@ export default {
isBreakoutRoom() {
return this.conversation.objectType === 'room'
},

callButtonTooltipText() {
if (blockCalls) {
return unsupportedWarning
} else {
// Passing a falsy value into the content of the tooltip
// is the only way to disable it conditionally.
return false
}
},
},

mounted() {
Expand Down
132 changes: 0 additions & 132 deletions src/mixins/browserCheck.js

This file was deleted.

Loading
Loading