Added Warehouse getSession conditions

This commit is contained in:
Srinath 2026-03-05 19:09:39 +05:30
parent 52e0fe705a
commit 47b35ddd59
1 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import {
checkSession, checkSession,
getCompBranchData, getCompBranchData,
getCommonAppPreference, getCommonAppPreference,
changeWarehouse,
} from './Features/BrachLogin/BranchLogin.js'; } from './Features/BrachLogin/BranchLogin.js';
import { clearSession, getSession } from './Services/Others'; import { clearSession, getSession } from './Services/Others';
import { import {
@ -39,6 +40,7 @@ const ProtectedRoutes = ({ routesConfig }) => {
const BranchId = getSession('BranchId'); const BranchId = getSession('BranchId');
const UserId = getSession('UserId'); const UserId = getSession('UserId');
const sessionId = getSession('SessionId'); const sessionId = getSession('SessionId');
const Warehouse = getSession('Warehouse');
const [accessCheckComplete, setAccessCheckComplete] = useState(false); const [accessCheckComplete, setAccessCheckComplete] = useState(false);
const FeatureAddonData = useSelector(GlobalFeatAddOnData); const FeatureAddonData = useSelector(GlobalFeatAddOnData);
useTemplate(CompId, BranchId, AppId); useTemplate(CompId, BranchId, AppId);
@ -46,7 +48,12 @@ const ProtectedRoutes = ({ routesConfig }) => {
useEffect(() => { useEffect(() => {
getApplicationPreference(); getApplicationPreference();
}, []); }, []);
//sri
useEffect(() => {
if (Warehouse) {
dispatch(changeWarehouse(true));
}
}, [Warehouse]);
const getApplicationPreference = async () => { const getApplicationPreference = async () => {
await dispatch(getCommonAppPreference(AppId)).unwrap(); await dispatch(getCommonAppPreference(AppId)).unwrap();
}; };