Skip to content

Commit

Permalink
Fix missing space image in sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Aug 18, 2022
1 parent d1c1142 commit 4ef3a73
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-space-image-sidebar
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Missing space image in sidebar

We've fixed a bug where the image of a space was not showing in the sidebar.

https://github.com/owncloud/web/issues/7480
https://github.com/owncloud/web/pull/7481
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import { ImageDimension } from '../../../constants'
import { useAccessToken, useStore } from 'web-pkg/src/composables'
import SpaceQuota from '../../SpaceQuota.vue'
import { formatDateFromISO } from 'web-pkg/src/helpers'
import { configurationManager } from 'web-pkg/src/configuration'
export default defineComponent({
name: 'SpaceDetails',
Expand All @@ -91,21 +92,25 @@ export default defineComponent({
return
}
const webDavPathComponents = ref.space.spaceImageData.webDavUrl.split('/')
const webDavPathComponents = decodeURI(ref.space.spaceImageData.webDavUrl).split('/')
const idComponent = webDavPathComponents.find((c) => c.startsWith(ref.space.id))
if (!idComponent) {
return
}
const path = webDavPathComponents
.slice(webDavPathComponents.indexOf(ref.space.id) + 1)
.slice(webDavPathComponents.indexOf(idComponent) + 1)
.join('/')
const fileInfo = yield ref.$client.files.fileInfo(
buildWebDavSpacesPath(ref.space.id, decodeURIComponent(path))
buildWebDavSpacesPath(idComponent, decodeURIComponent(path))
)
const resource = buildResource(fileInfo)
spaceImage.value = yield loadPreview({
resource,
isPublic: false,
dimensions: ImageDimension.Preview,
server: ref.configuration.server,
server: configurationManager.serverUrl,
userId: ref.user.id,
token: unref(accessToken)
})
Expand Down

0 comments on commit 4ef3a73

Please sign in to comment.