chore: debug debug
This commit is contained in:
@@ -100,7 +100,8 @@ export default {
|
||||
},
|
||||
setLocale(locale) {
|
||||
console.log('setting locale in dashboard', locale);
|
||||
this.$i18n.locale = locale;
|
||||
return;
|
||||
// this.$i18n.locale = locale;
|
||||
},
|
||||
async initializeAccount() {
|
||||
await this.$store.dispatch('accounts/get');
|
||||
|
||||
@@ -116,28 +116,18 @@ export default {
|
||||
return getSidebarItems(this.accountId);
|
||||
},
|
||||
primaryMenuItems() {
|
||||
console.group('Primary Menu Items');
|
||||
console.log(this.currentUser);
|
||||
console.log(this.accountId);
|
||||
console.log(this.sideMenuConfig.primaryMenu);
|
||||
const userPermissions = getUserPermissions(
|
||||
this.currentUser,
|
||||
this.accountId
|
||||
);
|
||||
|
||||
console.log(userPermissions);
|
||||
console.groupEnd();
|
||||
const menuItems = this.sideMenuConfig.primaryMenu;
|
||||
return menuItems.filter(menuItem => {
|
||||
console.log('----------------', menuItem.toStateName);
|
||||
console.log(menuItem);
|
||||
const isAvailableForTheUser = hasPermissions(
|
||||
routesWithPermissions[menuItem.toStateName],
|
||||
userPermissions
|
||||
);
|
||||
|
||||
console.log(isAvailableForTheUser);
|
||||
|
||||
if (!isAvailableForTheUser) {
|
||||
return false;
|
||||
}
|
||||
@@ -146,7 +136,6 @@ export default {
|
||||
menuItem.alwaysVisibleOnChatwootInstances &&
|
||||
!this.isACustomBrandedInstance
|
||||
) {
|
||||
console.log('NOT CUSTOM');
|
||||
return true;
|
||||
}
|
||||
if (menuItem.featureFlag) {
|
||||
@@ -154,11 +143,9 @@ export default {
|
||||
this.accountId,
|
||||
menuItem.featureFlag
|
||||
);
|
||||
console.log('CHECK ENDBALED', isEnabled);
|
||||
|
||||
return isEnabled;
|
||||
}
|
||||
console.log('RETURN TRUE');
|
||||
return true;
|
||||
});
|
||||
},
|
||||
|
||||
@@ -43,7 +43,11 @@ export const getters = {
|
||||
return diffDays <= TRIAL_PERIOD_DAYS;
|
||||
},
|
||||
isFeatureEnabledonAccount: $state => (id, featureName) => {
|
||||
console.log('----------------------------------------------------');
|
||||
console.log('CHECK ENABLED for', featureName);
|
||||
console.log($state, findRecordById($state, id));
|
||||
const { features = {} } = findRecordById($state, id);
|
||||
console.log('FEATURES', features, features[featureName]);
|
||||
return features[featureName] || false;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -65,8 +65,34 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
const { websiteToken, locale, widgetColor } = window.chatwootWebChannel;
|
||||
console.log('SET LOCALE', locale);
|
||||
this.setLocale(locale);
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE AGAIN 100');
|
||||
this.setLocale(locale);
|
||||
}, 100);
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE AGAIN 200');
|
||||
this.setLocale(locale);
|
||||
}, 200);
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE AGAIN 300');
|
||||
this.setLocale(locale);
|
||||
}, 300);
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE AGAIN 400');
|
||||
this.setLocale(locale);
|
||||
}, 400);
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE AGAIN 500');
|
||||
this.setLocale(locale);
|
||||
}, 500);
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE YET AGAIN');
|
||||
this.setLocale(locale);
|
||||
}, 5000);
|
||||
this.setWidgetColor(widgetColor);
|
||||
setHeader(window.authToken);
|
||||
if (this.isIFrame) {
|
||||
@@ -121,24 +147,22 @@ export default {
|
||||
});
|
||||
},
|
||||
setLocale(localeWithVariation) {
|
||||
console.log('IGNORE SETTING LOCALE HAHAHAHAHA!', localeWithVariation);
|
||||
return;
|
||||
// console.log('SETTING LOACLE IN WIDGET');
|
||||
// if (!localeWithVariation) return;
|
||||
// const { enabledLanguages } = window.chatwootWebChannel;
|
||||
// const localeWithoutVariation = localeWithVariation.split('_')[0];
|
||||
// const hasLocaleWithoutVariation = enabledLanguages.some(
|
||||
// lang => lang.iso_639_1_code === localeWithoutVariation
|
||||
// );
|
||||
// const hasLocaleWithVariation = enabledLanguages.some(
|
||||
// lang => lang.iso_639_1_code === localeWithVariation
|
||||
// );
|
||||
if (!localeWithVariation) return;
|
||||
console.log('SETTING LOCALE HAHAHAHAHA!', localeWithVariation);
|
||||
const { enabledLanguages } = window.chatwootWebChannel;
|
||||
const localeWithoutVariation = localeWithVariation.split('_')[0];
|
||||
const hasLocaleWithoutVariation = enabledLanguages.some(
|
||||
lang => lang.iso_639_1_code === localeWithoutVariation
|
||||
);
|
||||
const hasLocaleWithVariation = enabledLanguages.some(
|
||||
lang => lang.iso_639_1_code === localeWithVariation
|
||||
);
|
||||
|
||||
// if (hasLocaleWithVariation) {
|
||||
// this.$i18n.locale = localeWithVariation;
|
||||
// } else if (hasLocaleWithoutVariation) {
|
||||
// this.$i18n.locale = localeWithoutVariation;
|
||||
// }
|
||||
if (hasLocaleWithVariation) {
|
||||
this.$i18n.locale = localeWithVariation;
|
||||
} else if (hasLocaleWithoutVariation) {
|
||||
this.$i18n.locale = localeWithoutVariation;
|
||||
}
|
||||
},
|
||||
registerUnreadEvents() {
|
||||
emitter.on(ON_AGENT_MESSAGE_RECEIVED, () => {
|
||||
|
||||
Reference in New Issue
Block a user