Skip to content
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
10 changes: 9 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import ConversationSettingsDialog from './components/ConversationSettings/Conver
import '@nextcloud/dialogs/styles/toast.scss'
import { CONVERSATION } from './constants.js'
import DeviceChecker from './components/DeviceChecker/DeviceChecker.vue'
import isMobile from '@nextcloud/vue/dist/Mixins/isMobile.js'

export default {
name: 'App',
Expand All @@ -88,6 +89,7 @@ export default {
sessionIssueHandler,
isInCall,
participant,
isMobile,
],

data() {
Expand Down Expand Up @@ -213,7 +215,7 @@ export default {

token() {
// Collapse the sidebar if it's a 1to1 conversation
if (this.isOneToOne || BrowserStorage.getItem('sidebarOpen') === 'false' || window.screen.width < (getComputedStyle(document.documentElement).getPropertyValue('--breakpoint-mobile') / 2)) {
if (this.isOneToOne || BrowserStorage.getItem('sidebarOpen') === 'false' || this.isMobile) {
this.$store.dispatch('hideSidebar')
} else if (BrowserStorage.getItem('sidebarOpen') === 'true') {
this.$store.dispatch('showSidebar')
Expand Down Expand Up @@ -375,6 +377,12 @@ export default {
} else if (BrowserStorage.getItem('sidebarOpen') === 'true') {
this.$store.dispatch('showSidebar')
}
if (this.$route.name === 'root' && this.isMobile) {
await this.$nextTick()
emit('toggle-navigation', {
open: true,
})
}
},

methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import Conversation from './Conversation.vue'
import Hint from '../../Hint.vue'
import LoadingPlaceholder from '../../LoadingPlaceholder.vue'
import { EventBus } from '../../../services/EventBus.js'
import { emit } from '@nextcloud/event-bus'
import isMobile from '@nextcloud/vue/dist/Mixins/isMobile.js'

export default {
name: 'ConversationsList',
Expand All @@ -46,6 +48,7 @@ export default {
Hint,
LoadingPlaceholder,
},
mixins: [isMobile],
props: {
searchText: {
type: String,
Expand Down Expand Up @@ -117,6 +120,11 @@ export default {
// Emit the click event so the search text in the leftsidebar can be reset.
handleConversationClick(item) {
this.$emit('click-search-result', item.token)
if (this.isMobile) {
emit('toggle-navigation', {
open: false,
})
}
},
},
}
Expand Down
7 changes: 7 additions & 0 deletions src/components/NewMessageForm/AdvancedInput/AdvancedInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ export default {
* Focuses the contenteditable div input
*/
focusInput() {
if (this.isMobile) {
return
}
if (!this.$route || this.$route.name === 'conversation') {
const contentEditable = this.$refs.contentEditable
// This is a hack but it's the only way I've found to focus a contenteditable div
Expand Down Expand Up @@ -416,6 +419,10 @@ export default {

return 'user'
},

isMobile() {
return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent)
},
},
}
</script>
Expand Down