Skip to content

Commit

Permalink
fix(files): Do not jump to top when fileId is set to currentFolder
Browse files Browse the repository at this point in the history
Fix #48545

Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Oct 29, 2024
1 parent 749b6f3 commit e7759f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/files/src/components/FilesListVirtual.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ export default defineComponent({

scrollToFile(fileId: number|null, warn = true) {
if (fileId) {
// Do not uselessly scroll to the top of the list.
if (fileId === this.currentFolder.fileid) {
return
}

const index = this.nodes.findIndex(node => node.fileid === fileId)
if (warn && index === -1 && fileId !== this.currentFolder.fileid) {
showError(this.t('files', 'File not found'))
Expand Down

0 comments on commit e7759f6

Please sign in to comment.