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

Disable shares loading on public and trash locations #7739

Merged
merged 1 commit into from
Oct 5, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Disable shares loading on public and trash locations

We've disabled shares loading on public and trash locations as it's not needed.

https://github.com/owncloud/web/pull/7739
https://github.com/owncloud/web/issues/7667
17 changes: 7 additions & 10 deletions packages/web-app-files/src/components/SideBar/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
isLocationCommonActive,
isLocationPublicActive,
isLocationSharesActive,
isLocationSpacesActive
isLocationTrashActive
} from '../../router'
import { computed, defineComponent, PropType } from '@vue/composition-api'
import {
Expand Down Expand Up @@ -112,7 +112,6 @@ export default defineComponent({
const { webdav } = useClientService()

return {
isSpacesProjectsLocation: useActiveLocation(isLocationSpacesActive, 'files-spaces-projects'),
isSharedWithMeLocation: useActiveLocation(isLocationSharesActive, 'files-shares-with-me'),
isSharedWithOthersLocation: useActiveLocation(
isLocationSharesActive,
Expand All @@ -122,6 +121,7 @@ export default defineComponent({
isFavoritesLocation: useActiveLocation(isLocationCommonActive, 'files-common-favorites'),
isSearchLocation: useActiveLocation(isLocationCommonActive, 'files-common-search'),
isPublicFilesLocation: useActiveLocation(isLocationPublicActive, 'files-public-link'),
isTrashLocation: useActiveLocation(isLocationTrashActive, 'files-trash-generic'),
hasShareJail: useCapabilityShareJailEnabled(),
publicLinkPassword: usePublicLinkPassword({ store }),
setActiveSideBarPanel,
Expand All @@ -142,7 +142,7 @@ export default defineComponent({
},

computed: {
...mapGetters('Files', ['highlightedFile', 'selectedFiles']),
...mapGetters('Files', ['highlightedFile', 'selectedFiles', 'currentFolder']),
...mapGetters(['fileSideBars', 'capabilities']),
...mapGetters('runtime/spaces', ['spaces']),
...mapState(['user']),
Expand Down Expand Up @@ -203,6 +203,9 @@ export default defineComponent({
},
highlightedFileIsSpace() {
return this.highlightedFile?.type === 'space'
},
sharesLoadingDisabledOnCurrentRoute() {
return this.isPublicFilesLocation || this.isTrashLocation
}
},
watch: {
Expand All @@ -214,13 +217,7 @@ export default defineComponent({
}

const loadShares =
!!oldFile ||
this.isSpacesProjectsLocation ||
this.isSharedWithMeLocation ||
this.isSharedWithOthersLocation ||
this.isSharedViaLinkLocation ||
this.isSearchLocation ||
this.isFavoritesLocation
!this.sharesLoadingDisabledOnCurrentRoute && (!!oldFile || !this.currentFolder)
this.fetchFileInfo(loadShares)
},
deep: true
Expand Down