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>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
This commit is contained in:
Louis Chemineau 2024-10-09 18:23:58 +02:00 committed by nextcloud-command
parent 749b6f3f68
commit f3dd25fa64
3 changed files with 8 additions and 3 deletions

View file

@ -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'))

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