mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
BIG-18: missing locales in Arabic.
This commit is contained in:
@@ -84,4 +84,22 @@ export function appIntlIsLoading(toggle) {
|
||||
type: t.APP_INTL_IS_LOADING,
|
||||
payload: { isLoading: toggle },
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Splash start loading.
|
||||
*/
|
||||
export function splashStartLoading() {
|
||||
return {
|
||||
type: t.SPLASH_START_LOADING,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Splash stop loading.
|
||||
*/
|
||||
export function splashStopLoading() {
|
||||
return {
|
||||
type: t.SPLASH_STOP_LOADING,
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createReducer } from '@reduxjs/toolkit';
|
||||
import { isUndefined } from 'lodash';
|
||||
import { isUndefined, isNumber } from 'lodash';
|
||||
import t from 'store/types';
|
||||
import { persistReducer, purgeStoredState } from 'redux-persist';
|
||||
import storage from 'redux-persist/lib/storage';
|
||||
@@ -16,6 +16,7 @@ const initialState = {
|
||||
topbarEditViewId: null,
|
||||
requestsLoading: 0,
|
||||
backLink: false,
|
||||
splashScreenLoading: null,
|
||||
appIsLoading: true,
|
||||
appIntlIsLoading: true,
|
||||
};
|
||||
@@ -102,14 +103,17 @@ const reducerInstance = createReducer(initialState, {
|
||||
state.backLink = backLink;
|
||||
},
|
||||
|
||||
[t.APP_IS_LOADING]: (state, action) => {
|
||||
const { isLoading } = action.payload;
|
||||
state.appIsLoading = isLoading;
|
||||
[t.SPLASH_START_LOADING]: (state) => {
|
||||
if (isNumber(state.splashScreenLoading)) {
|
||||
state.splashScreenLoading += 1;
|
||||
} else {
|
||||
state.splashScreenLoading = 1;
|
||||
}
|
||||
},
|
||||
|
||||
[t.APP_INTL_IS_LOADING]: (state, action) => {
|
||||
const { isLoading } = action.payload;
|
||||
state.appIntlIsLoading = isLoading;
|
||||
[t.SPLASH_STOP_LOADING]: (state) => {
|
||||
state.splashScreenLoading -= 1;
|
||||
state.splashScreenLoading = Math.max(state.splashScreenLoading, 0);
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
|
||||
@@ -14,6 +14,6 @@ export default {
|
||||
SET_TOPBAR_EDIT_VIEW: 'SET_TOPBAR_EDIT_VIEW',
|
||||
SIDEBAR_EXPEND_TOGGLE: 'SIDEBAR_EXPEND_TOGGLE',
|
||||
SET_DASHBOARD_BACK_LINK: 'SET_DASHBOARD_BACK_LINK',
|
||||
APP_IS_LOADING: 'APP_IS_LOADING',
|
||||
APP_INTL_IS_LOADING: 'APP_INTL_IS_LOADING'
|
||||
SPLASH_START_LOADING: 'SPLASH_START_LOADING',
|
||||
SPLASH_STOP_LOADING: 'SPLASH_STOP_LOADING',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user