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: FilesViewerLoading was imported from a file that did not export it #3239

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 8 additions & 5 deletions src/modules/views/Drive/FilesViewerDrive.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { useNavigate } from 'react-router-dom'

import { useQuery } from 'cozy-client'

import { FilesViewerLoading } from 'components/FilesViewerLoading'
import { useFolderSort } from 'modules/navigation/duck'
import { getFolderPath } from 'modules/routeUtils'
import FilesViewer, { FilesViewerLoading } from 'modules/viewer/FilesViewer'
import FilesViewer from 'modules/viewer/FilesViewer'
import { buildDriveQuery } from 'queries'

const FilesViewerDrive = () => {
Expand All @@ -20,13 +21,15 @@ const FilesViewerDrive = () => {
sortAttribute: sortOrder.attribute,
sortOrder: sortOrder.order
})

const filesQuery = useQuery(
buildedFilesQuery.definition,
buildedFilesQuery.options
)

if (filesQuery.data) {
const viewableFiles = filesQuery.data
const viewableFiles = filesQuery.data

if (viewableFiles) {
return (
<FilesViewer
files={viewableFiles}
Expand All @@ -37,9 +40,9 @@ const FilesViewerDrive = () => {
}
/>
)
} else {
return <FilesViewerLoading />
}

return <FilesViewerLoading />
}

export default FilesViewerDrive
3 changes: 2 additions & 1 deletion src/modules/views/Recent/FilesViewerRecent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { useNavigate } from 'react-router-dom'

import { useQuery } from 'cozy-client'

import FilesViewer, { FilesViewerLoading } from 'modules/viewer/FilesViewer'
import { FilesViewerLoading } from 'components/FilesViewerLoading'
import FilesViewer from 'modules/viewer/FilesViewer'
import { buildRecentQuery } from 'queries'

const FilesViewerRecent = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/modules/views/Sharings/FilesViewerSharings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { useNavigate } from 'react-router-dom'
import { useQuery } from 'cozy-client'

import withSharedDocumentIds from './withSharedDocumentIds'
import FilesViewer, { FilesViewerLoading } from 'modules/viewer/FilesViewer'
import { FilesViewerLoading } from 'components/FilesViewerLoading'
import FilesViewer from 'modules/viewer/FilesViewer'
import { buildSharingsQuery } from 'queries'

const FilesViewerSharing = ({ sharedDocumentIds }) => {
Expand Down
3 changes: 2 additions & 1 deletion src/modules/views/Trash/FilesViewerTrash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { useNavigate } from 'react-router-dom'

import { useQuery } from 'cozy-client'

import { FilesViewerLoading } from 'components/FilesViewerLoading'
import { useFolderSort } from 'modules/navigation/duck'
import FilesViewer, { FilesViewerLoading } from 'modules/viewer/FilesViewer'
import FilesViewer from 'modules/viewer/FilesViewer'
import { buildTrashQuery } from 'queries'

const FilesViewerTrash = () => {
Expand Down
Loading