chore: Adds the ability to automatically initialize the RTL direction (#6531)

This commit is contained in:
Sivin Varghese
2023-02-27 12:03:40 +05:30
committed by GitHub
parent bfb445186d
commit eb55ff5c9b
2 changed files with 10 additions and 0 deletions

View File

@@ -104,6 +104,7 @@ export default {
} = this.getAccount(this.currentAccountId); } = this.getAccount(this.currentAccountId);
const { pubsub_token: pubsubToken } = this.currentUser || {}; const { pubsub_token: pubsubToken } = this.currentUser || {};
this.setLocale(locale); this.setLocale(locale);
this.updateRTLDirectionView(locale);
this.latestChatwootVersion = latestChatwootVersion; this.latestChatwootVersion = latestChatwootVersion;
vueActionCable.init(pubsubToken); vueActionCable.init(pubsubToken);
}, },

View File

@@ -1,4 +1,5 @@
import uiSettingsMixin from 'dashboard/mixins/uiSettings'; import uiSettingsMixin from 'dashboard/mixins/uiSettings';
import { getLanguageDirection } from 'dashboard/components/widgets/conversation/advancedFilterItems/languages';
export default { export default {
mixins: [uiSettingsMixin], mixins: [uiSettingsMixin],
@@ -8,4 +9,12 @@ export default {
return isRTLView; return isRTLView;
}, },
}, },
methods: {
updateRTLDirectionView(locale) {
const isRTLSupported = getLanguageDirection(locale);
this.updateUISettings({
rtl_view: isRTLSupported,
});
},
},
}; };