fix: Update survey locale based on the account (#4207)

This commit is contained in:
Pranav Raj S
2022-03-20 13:07:36 +05:30
committed by GitHub
parent 8372ae418e
commit 6097f4c122
8 changed files with 99 additions and 8 deletions

View File

@@ -21,7 +21,6 @@
<script>
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
import { mapGetters } from 'vuex';
const {
LOGO_THUMBNAIL: logoThumbnail,
@@ -41,13 +40,20 @@ export default {
};
},
computed: {
...mapGetters({ referrerHost: 'appConfig/getReferrerHost' }),
brandRedirectURL() {
const baseURL = `${this.globalConfig.widgetBrandURL}?utm_source=widget_branding`;
if (this.referrerHost) {
return `${baseURL}&utm_referrer=${this.referrerHost}`;
try {
const referrerHost = this.$store.getters['appConfig/getReferrerHost'];
const baseURL = `${this.globalConfig.widgetBrandURL}?utm_source=${
referrerHost ? 'widget_branding' : 'survey_branding'
}`;
if (referrerHost) {
return `${baseURL}&utm_referrer=${referrerHost}`;
}
return baseURL;
} catch (e) {
// Suppressing the error as getter is not defined in some cases
}
return baseURL;
return '';
},
},
};