Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(files): fix default sorting direction #41330

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/files/src/mixins/filesSorting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import type { Navigation, View } from '@nextcloud/files'
import Vue from 'vue'

import { mapState } from 'pinia'
import { useViewConfigStore } from '../store/viewConfig'
import { Navigation, View } from '@nextcloud/files'

export default Vue.extend({
computed: {
Expand All @@ -46,7 +46,8 @@ export default Vue.extend({
* Get the sorting direction for the current view
*/
isAscSorting(): boolean {
const sortingDirection = this.getConfig(this.currentView.id)?.sorting_direction
const sortingDirection = this.getConfig(this.currentView.id)?.sorting_direction as string
|| 'asc'
return sortingDirection === 'asc'
},
},
Expand Down
3 changes: 0 additions & 3 deletions apps/files/src/views/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ import { usePathsStore } from '../store/paths.ts'
import { useSelectionStore } from '../store/selection.ts'
import { useUploaderStore } from '../store/uploader.ts'
import { useUserConfigStore } from '../store/userconfig.ts'
import { useViewConfigStore } from '../store/viewConfig.ts'
import BreadCrumbs from '../components/BreadCrumbs.vue'
import FilesListVirtual from '../components/FilesListVirtual.vue'
import filesListWidthMixin from '../mixins/filesListWidth.ts'
Expand Down Expand Up @@ -165,14 +164,12 @@ export default Vue.extend({
const selectionStore = useSelectionStore()
const uploaderStore = useUploaderStore()
const userConfigStore = useUserConfigStore()
const viewConfigStore = useViewConfigStore()
return {
filesStore,
pathsStore,
selectionStore,
uploaderStore,
userConfigStore,
viewConfigStore,
}
},

Expand Down
Loading