@@ -155,7 +155,7 @@ import { getCapabilities } from '@nextcloud/capabilities'
155155import { emit , subscribe , unsubscribe } from ' @nextcloud/event-bus'
156156import { Node , Permission , sortNodes , getFileListActions } from ' @nextcloud/files'
157157import { translate as t } from ' @nextcloud/l10n'
158- import { join , dirname , normalize } from ' path'
158+ import { join , dirname , normalize , relative } from ' path'
159159import { showError , showSuccess , showWarning } from ' @nextcloud/dialogs'
160160import { ShareType } from ' @nextcloud/sharing'
161161import { UploadPicker , UploadStatus } from ' @nextcloud/upload'
@@ -356,12 +356,28 @@ export default defineComponent({
356356 return this .isAscSorting ? results : results .reverse ()
357357 }
358358
359- return sortNodes (this .dirContentsFiltered , {
359+ const nodes = sortNodes (this .dirContentsFiltered , {
360360 sortFavoritesFirst: this .userConfig .sort_favorites_first ,
361361 sortFoldersFirst: this .userConfig .sort_folders_first ,
362362 sortingMode: this .sortingMode ,
363363 sortingOrder: this .isAscSorting ? ' asc' : ' desc' ,
364364 })
365+
366+ // TODO upstream this
367+ if (this .currentView .id === ' files' ) {
368+ nodes .sort ((a , b ) => {
369+ const aa = relative (a .source , this .currentFolder ! .source ) === ' ..'
370+ const bb = relative (b .source , this .currentFolder ! .source ) === ' ..'
371+ if (aa && bb ) {
372+ return 0
373+ } else if (aa ) {
374+ return - 1
375+ }
376+ return 1
377+ })
378+ }
379+
380+ return nodes
365381 },
366382
367383 /**
0 commit comments