diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2023-12-06 17:46:17 +0100 |
---|---|---|
committer | fenn-cs <fenn25.fn@gmail.com> | 2023-12-06 22:11:27 +0100 |
commit | 06314a37c15ea90df47f295d8add6d1c3c8544cd (patch) | |
tree | 418e119967ae196ff685e762fa1a0f9b62f44fc8 /apps/files_sharing/src/views/SharingTab.vue | |
parent | f6b49b11324cbab82e2aeb053d883b736e9becac (diff) | |
download | nextcloud-server-06314a37c15ea90df47f295d8add6d1c3c8544cd.tar.gz nextcloud-server-06314a37c15ea90df47f295d8add6d1c3c8544cd.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>
Diffstat (limited to 'apps/files_sharing/src/views/SharingTab.vue')
-rw-r--r-- | apps/files_sharing/src/views/SharingTab.vue | 13 |
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 6ec8f25fcf6..19033bf9184 100644 --- a/apps/files_sharing/src/views/SharingTab.vue +++ b/apps/files_sharing/src/views/SharingTab.vue @@ -374,14 +374,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) |