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(files): reduce number of fetch contents on load #47102

Merged
merged 3 commits into from
Aug 7, 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
1 change: 0 additions & 1 deletion apps/files/src/store/userconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const useUserConfigStore = function(...args) {
await axios.put(generateUrl('/apps/files/api/v1/config/' + key), {
value,
})

emit('files:config:updated', { key, value })
},
},
Expand Down
5 changes: 2 additions & 3 deletions apps/files/src/views/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ export default defineComponent({
promise: null as CancelablePromise<ContentsWithRoot> | Promise<ContentsWithRoot> | null,

dirContentsFiltered: [] as INode[],

unsubscribeStoreCallback: () => {},
}
},

Expand Down Expand Up @@ -466,12 +464,13 @@ export default defineComponent({
subscribe('files:node:updated', this.onUpdatedNode)

// reload on settings change
this.unsubscribeStoreCallback = this.userConfigStore.$subscribe(() => this.fetchContent(), { deep: true })
subscribe('files:config:updated', this.fetchContent)
},

unmounted() {
unsubscribe('files:node:deleted', this.onNodeDeleted)
unsubscribe('files:node:updated', this.onUpdatedNode)
unsubscribe('files:config:updated', this.fetchContent)
},

methods: {
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/src/views/SharingTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export default {
this.processSharedWithMe(sharedWithMe)
this.processShares(shares)
} catch (error) {
if (error.response.data?.ocs?.meta?.message) {
if (error?.response?.data?.ocs?.meta?.message) {
this.error = error.response.data.ocs.meta.message
} else {
this.error = t('files_sharing', 'Unable to load the shares list')
Expand Down
4 changes: 2 additions & 2 deletions dist/5963-5963.js → dist/1019-1019.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/5963-5963.js.license → dist/1019-1019.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This file is generated from multiple sources. Included packages:
- version: 5.0.1
- license: MIT
- @nextcloud/upload
- version: 1.4.2
- version: 1.4.3
- license: AGPL-3.0-or-later
- @nextcloud/vue
- version: 8.16.0
Expand Down
2 changes: 1 addition & 1 deletion dist/5963-5963.js.map → dist/1019-1019.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/1019-1019.js.map.license
2 changes: 2 additions & 0 deletions dist/3167-3167.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/3167-3167.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/3167-3167.js.map.license
1 change: 0 additions & 1 deletion dist/5963-5963.js.map.license

This file was deleted.

2 changes: 0 additions & 2 deletions dist/6880-6880.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/6880-6880.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/6880-6880.js.map.license

This file was deleted.

4 changes: 2 additions & 2 deletions dist/files-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-init.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ This file is generated from multiple sources. Included packages:
- version: 5.0.1
- license: MIT
- @nextcloud/upload
- version: 1.4.2
- version: 1.4.3
- license: AGPL-3.0-or-later
- @nextcloud/vue
- version: 8.16.0
Expand Down
2 changes: 1 addition & 1 deletion dist/files-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ This file is generated from multiple sources. Included packages:
- version: 5.0.1
- license: MIT
- @nextcloud/upload
- version: 1.4.2
- version: 1.4.3
- license: AGPL-3.0-or-later
- @nextcloud/vue
- version: 8.16.0
Expand Down
2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@nextcloud/paths": "^2.2.1",
"@nextcloud/router": "^3.0.0",
"@nextcloud/sharing": "^0.2.3",
"@nextcloud/upload": "^1.4.2",
"@nextcloud/upload": "^1.4.3",
"@nextcloud/vue": "^8.16.0",
"@simplewebauthn/browser": "^10.0.0",
"@skjnldsv/sanitize-svg": "^1.0.2",
Expand Down
Loading