Skip to content

Commit

Permalink
Remove unnecessary stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Sep 30, 2022
1 parent 34016c3 commit 9fba893
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 33 deletions.
11 changes: 0 additions & 11 deletions packages/web-app-files/src/components/SideBar/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import isEqual from 'lodash-es/isEqual'
import { useActiveLocation } from '../../composables'
import { SpaceResource } from 'web-client/src/helpers'
import { WebDAV } from 'web-client/src/webdav'
import { ShareTypes } from 'web-client/src/helpers/share'
export default defineComponent({
components: { FileInfo, SpaceInfo, SideBar },
Expand Down Expand Up @@ -114,7 +113,6 @@ export default defineComponent({
const { webdav } = useClientService()
return {
isSpacesGenericLocation: useActiveLocation(isLocationSpacesActive, 'files-spaces-generic'),
isSpacesProjectsLocation: useActiveLocation(isLocationSpacesActive, 'files-spaces-projects'),
isSharedWithMeLocation: useActiveLocation(isLocationSharesActive, 'files-shares-with-me'),
isSharedWithOthersLocation: useActiveLocation(
Expand Down Expand Up @@ -202,15 +200,6 @@ export default defineComponent({
if (this.hasShareJail && this.space?.driveType === 'share') {
return false
}
if (
!pathSegments.length &&
this.highlightedFile?.shareTypes?.includes(ShareTypes.link.value) &&
this.isSpacesGenericLocation
) {
console.log('ALIAS LINK')
// alias link for a single resource
return false
}
return !pathSegments.length
},
highlightedFileThumbnail() {
Expand Down
12 changes: 1 addition & 11 deletions packages/web-app-files/src/helpers/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ export function buildResource(resource): Resource {
}

const id = resource.fileInfo[DavProperty.FileId]
const pathParts = resource.name.split('/')
let webDavPath
if (pathParts.length === 3 && !isFolder && pathParts[2].includes('!')) {
// idComponent includes the opaqueID which represents the resource name.
// For the webdav path, we need to replace the opaqueID with the actual resource name.
const withoutOpaqueId = resource.name.split('!')[0]
webDavPath = `${withoutOpaqueId}/${name}`
} else {
webDavPath = resource.name
}

return {
id,
Expand All @@ -64,7 +54,7 @@ export function buildResource(resource): Resource {
name,
extension: isFolder ? '' : extension,
path: resourcePath,
webDavPath,
webDavPath: resource.name,
type: isFolder ? 'folder' : resource.type,
isFolder,
mdate: resource.fileInfo[DavProperty.LastModifiedDate],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ export class FolderLoaderLegacyPersonal implements FolderLoader {

const resources = yield webdav.listFiles(space, { path })

const currentFolder =
resources.length > 1 || resources[0].isFolder ? resources.shift() : undefined
if (currentFolder) {
yield store.dispatch('Files/loadSharesTree', {
client,
path: currentFolder.path
})

for (const file of resources) {
file.indicators = getIndicators(file, store.state.Files.sharesTree, false)
}
const currentFolder = resources.shift()
yield store.dispatch('Files/loadSharesTree', {
client,
path: currentFolder.path
})

for (const file of resources) {
file.indicators = getIndicators(file, store.state.Files.sharesTree, false)
}

store.commit('Files/LOAD_FILES', {
Expand Down

0 comments on commit 9fba893

Please sign in to comment.