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,
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();
};