Added Warehouse getSession conditions
This commit is contained in:
parent
52e0fe705a
commit
47b35ddd59
|
|
@ -9,6 +9,7 @@ import {
|
|||
checkSession,
|
||||
getCompBranchData,
|
||||
getCommonAppPreference,
|
||||
changeWarehouse,
|
||||
} from './Features/BrachLogin/BranchLogin.js';
|
||||
import { clearSession, getSession } from './Services/Others';
|
||||
import {
|
||||
|
|
@ -39,6 +40,7 @@ const ProtectedRoutes = ({ routesConfig }) => {
|
|||
const BranchId = getSession('BranchId');
|
||||
const UserId = getSession('UserId');
|
||||
const sessionId = getSession('SessionId');
|
||||
const Warehouse = getSession('Warehouse');
|
||||
const [accessCheckComplete, setAccessCheckComplete] = useState(false);
|
||||
const FeatureAddonData = useSelector(GlobalFeatAddOnData);
|
||||
useTemplate(CompId, BranchId, AppId);
|
||||
|
|
@ -46,7 +48,12 @@ const ProtectedRoutes = ({ routesConfig }) => {
|
|||
useEffect(() => {
|
||||
getApplicationPreference();
|
||||
}, []);
|
||||
|
||||
//sri
|
||||
useEffect(() => {
|
||||
if (Warehouse) {
|
||||
dispatch(changeWarehouse(true));
|
||||
}
|
||||
}, [Warehouse]);
|
||||
const getApplicationPreference = async () => {
|
||||
await dispatch(getCommonAppPreference(AppId)).unwrap();
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue