x
This commit is contained in:
18
src/App.js
18
src/App.js
@@ -282,6 +282,7 @@ function App() {
|
||||
setDeviceType("guestDevice");
|
||||
} else {
|
||||
console.log(data)
|
||||
if(data.data.user.cafeId != null) navigate(`/${data.data.user.cafeIdentityName}`, { replace: true });
|
||||
setUser(data.data.user);
|
||||
if (data.data.latestOpenBillTransaction != null) localStorage.setItem('lastTransaction', JSON.stringify(data.data.latestOpenBillTransaction))
|
||||
if (
|
||||
@@ -294,7 +295,6 @@ function App() {
|
||||
setGuestSides(connectedGuestSides.sessionDatas);
|
||||
console.log("getting guest side");
|
||||
setDeviceType("clerk");
|
||||
|
||||
checkNotifications();
|
||||
} else {
|
||||
setDeviceType("guestDevice");
|
||||
@@ -394,16 +394,16 @@ function App() {
|
||||
};
|
||||
}, [socket, shopId, location]); // Ensure location is in the dependencies to respond to changes in the URL
|
||||
|
||||
useEffect(() => {
|
||||
if (user.cafeId != null && user.cafeId !== shopId) {
|
||||
// Preserve existing query parameters
|
||||
const currentParams = new URLSearchParams(location.search).toString();
|
||||
// useEffect(() => {
|
||||
// if (user.cafeId != null && user.cafeId !== shopId) {
|
||||
// // Preserve existing query parameters
|
||||
// const currentParams = new URLSearchParams(location.search).toString();
|
||||
|
||||
// Navigate to the new cafeId while keeping existing params
|
||||
navigate(`/${user.cafeId}?${currentParams}`, { replace: true });
|
||||
}
|
||||
// // Navigate to the new cafeId while keeping existing params
|
||||
// navigate(`/${user.cafeId}?${currentParams}`, { replace: true });
|
||||
// }
|
||||
|
||||
}, [user, shopId]);
|
||||
// }, [user, shopId]);
|
||||
|
||||
function handleMoveToTransaction(direction, from) {
|
||||
console.log(direction);
|
||||
|
||||
Reference in New Issue
Block a user