fix(files): Do not jump to top when fileId is set to currentFolder

Fix https://github.com/nextcloud/server/issues/48545

Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
Louis Chemineau 2024-10-09 18:23:58 +02:00 committed by skjnldsv
parent 11f0b0f817
commit 7b27d052ad
3 changed files with 8 additions and 3 deletions

View file

@ -252,6 +252,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'))

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long