feat: Replace rtlMixin to a composable (#9924)
This PR will replace the usage of `rtlMixin` to the `useUISettings` composable, and moved the method to component itself.
This commit is contained in:
@@ -4,6 +4,7 @@ import AccountAPI from '../../api/account';
|
||||
import { differenceInDays } from 'date-fns';
|
||||
import EnterpriseAccountAPI from '../../api/enterprise/account';
|
||||
import { throwErrorMessage } from '../utils/api';
|
||||
import { getLanguageDirection } from 'dashboard/components/widgets/conversation/advancedFilterItems/languages';
|
||||
|
||||
const findRecordById = ($state, id) =>
|
||||
$state.records.find(record => record.id === Number(id)) || {};
|
||||
@@ -27,6 +28,13 @@ export const getters = {
|
||||
getUIFlags($state) {
|
||||
return $state.uiFlags;
|
||||
},
|
||||
isRTL: ($state, _, rootState) => {
|
||||
const accountId = rootState.route?.params?.accountId;
|
||||
if (!accountId) return false;
|
||||
|
||||
const { locale } = findRecordById($state, Number(accountId));
|
||||
return locale ? getLanguageDirection(locale) : false;
|
||||
},
|
||||
isTrialAccount: $state => id => {
|
||||
const account = findRecordById($state, id);
|
||||
const createdAt = new Date(account.created_at);
|
||||
|
||||
Reference in New Issue
Block a user