From 803471e42fce3021b7a53c041cf072c72166eb9a Mon Sep 17 00:00:00 2001 From: Pavel Kuzmin Date: Sun, 2 Jun 2024 18:36:10 +0500 Subject: [PATCH] fix: browser info (#9569) # Pull Request Template ## Description fixed getting browser data In Vue, without computed properties, the data doesn't update, and because of this, it doesn't display information about the browser. ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality not to work as expected) - [ ] This change requires a documentation update ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --- .../routes/dashboard/conversation/ConversationInfo.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/javascript/dashboard/routes/dashboard/conversation/ConversationInfo.vue b/app/javascript/dashboard/routes/dashboard/conversation/ConversationInfo.vue index 5f488341d..2a095c063 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/ConversationInfo.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/ConversationInfo.vue @@ -19,12 +19,12 @@ const initiatedAt = computed( () => props.conversationAttributes.initiated_at?.timestamp ); -const browserInfo = props.conversationAttributes.browser; +const browserInfo = computed(() => props.conversationAttributes.browser); const browserName = computed(() => { - if (!browserInfo) return ''; + if (!browserInfo.value) return ''; const { browser_name: name = '', browser_version: version = '' } = - browserInfo; + browserInfo.value; return `${name} ${version}`; }); @@ -33,9 +33,9 @@ const browserLanguage = computed(() => ); const platformName = computed(() => { - if (!browserInfo) return ''; + if (!browserInfo.value) return ''; const { platform_name: name = '', platform_version: version = '' } = - browserInfo; + browserInfo.value; return `${name} ${version}`; });