Skip to content

Commit

Permalink
Scroll chat to bottom when adding temporary messages
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Ambrosini <marcoambrosini@pm.me>
  • Loading branch information
marcoambrosini committed Jul 27, 2020
1 parent a55773d commit 441f8b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/store/fileUploadStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { showError } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'
import { findUniquePath } from '../utils/fileUpload'
import createTemporaryMessage from '../utils/temporaryMessage'
import { EventBus } from '../services/EventBus'

const state = {
attachmentFolder: loadState('talk', 'attachment_folder'),
Expand Down Expand Up @@ -152,6 +153,8 @@ const actions = {
// Create temporary message for the file and add it to the message list
const temporaryMessage = createTemporaryMessage('{file}', token, uploadId, index, currentFile)
dispatch('addTemporaryMessage', temporaryMessage)
// Scroll the message list
EventBus.$emit('scrollChatToBottom')
// userRoot path
const userRoot = '/files/' + getters.getUserId()
// Candidate rest of the path
Expand Down

0 comments on commit 441f8b4

Please sign in to comment.