Skip to content

Commit 33a69bf

Browse files
susnuxskjnldsv
authored andcommitted
fix(files): use the configured default view for redirect
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 92f034e commit 33a69bf

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

apps/files/src/views/FilesList.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,20 @@ import ListViewIcon from 'vue-material-design-icons/FormatListBulletedSquare.vue
184184
import ViewGridIcon from 'vue-material-design-icons/ViewGrid.vue'
185185
186186
import { action as sidebarAction } from '../actions/sidebarAction.ts'
187-
import { getSummaryFor } from '../utils/fileUtils.ts'
188-
import { humanizeWebDAVError } from '../utils/davUtils.ts'
189187
import { useFileListWidth } from '../composables/useFileListWidth.ts'
190-
import { useFilesStore } from '../store/files.ts'
191-
import { useFiltersStore } from '../store/filters.ts'
192188
import { useNavigation } from '../composables/useNavigation.ts'
193-
import { usePathsStore } from '../store/paths.ts'
194189
import { useRouteParameters } from '../composables/useRouteParameters.ts'
195190
import { useActiveStore } from '../store/active.ts'
191+
import { useFilesStore } from '../store/files.ts'
192+
import { useFiltersStore } from '../store/filters.ts'
193+
import { usePathsStore } from '../store/paths.ts'
196194
import { useSelectionStore } from '../store/selection.ts'
197195
import { useUploaderStore } from '../store/uploader.ts'
198196
import { useUserConfigStore } from '../store/userconfig.ts'
199197
import { useViewConfigStore } from '../store/viewConfig.ts'
198+
import { humanizeWebDAVError } from '../utils/davUtils.ts'
199+
import { getSummaryFor } from '../utils/fileUtils.ts'
200+
import { defaultView } from '../utils/filesViews.ts'
200201
import BreadCrumbs from '../components/BreadCrumbs.vue'
201202
import DragAndDropNotice from '../components/DragAndDropNotice.vue'
202203
import FilesListVirtual from '../components/FilesListVirtual.vue'
@@ -609,14 +610,14 @@ export default defineComponent({
609610
const currentView = this.currentView
610611
611612
if (!currentView) {
612-
logger.debug('The current view doesn\'t exists or is not ready.', { currentView })
613+
logger.debug('The current view does not exists or is not ready.', { currentView })
613614
614615
// If we still haven't a valid view, let's wait for the page to load
615616
// then try again. Else redirect to the default view
616617
window.addEventListener('DOMContentLoaded', () => {
617618
if (!this.currentView) {
618619
logger.warn('No current view after DOMContentLoaded, redirecting to the default view')
619-
window.OCP.Files.Router.goToRoute(null, { view: 'files' })
620+
window.OCP.Files.Router.goToRoute(null, { view: defaultView() })
620621
}
621622
}, { once: true })
622623
return

0 commit comments

Comments
 (0)