summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2023-12-06 17:46:17 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2024-01-15 09:36:06 +0100
commite5d8303decaac44355c4a9ec48ed356f15539a44 (patch)
tree6d535bf9020a3c520aec1040db960df322578c7c
parentbaf49e395031dfa9a271998f1cf3c1a1e1029dfc (diff)
downloadnextcloud-server-e5d8303decaac44355c4a9ec48ed356f15539a44.tar.gz
nextcloud-server-e5d8303decaac44355c4a9ec48ed356f15539a44.zip
Create element reference inside $nextTick()
Accessing `this.$refs.shareList` outside $nextTick() could lead to the holder (`listComponent`) being undefined as the ref is yet to exist. Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
-rw-r--r--apps/files_sharing/src/views/SharingTab.vue13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue
index 4019a99dbe0..555a4de56ec 100644
--- a/apps/files_sharing/src/views/SharingTab.vue
+++ b/apps/files_sharing/src/views/SharingTab.vue
@@ -375,14 +375,13 @@ export default {
* @param {Function} resolve a function to execute after
*/
awaitForShare(share, resolve) {
- let listComponent = this.$refs.shareList
- // Only mail shares comes from the input, link shares
- // are managed internally in the SharingLinkList component
- if (share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL) {
- listComponent = this.$refs.linkShareList
- }
-
this.$nextTick(() => {
+ let listComponent = this.$refs.shareList
+ // Only mail shares comes from the input, link shares
+ // are managed internally in the SharingLinkList component
+ if (share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL) {
+ listComponent = this.$refs.linkShareList
+ }
const newShare = listComponent.$children.find(component => component.share === share)
if (newShare) {
resolve(newShare)