This commit is contained in:
Vassshhh
2025-08-25 23:41:35 +07:00
parent 53e091d3a4
commit 67cf759b31
16 changed files with 6738 additions and 4441 deletions

View File

@@ -74,6 +74,10 @@ function App() {
const [newTransaction, setNewTransaction] = useState({});
const queryParams = new URLSearchParams(location.search);
const tokenParams = queryParams.get("token");
if(tokenParams) localStorage.setItem('auth', tokenParams)
const validTransactionStates = [
'new_transaction',
'transaction_canceled',
@@ -226,7 +230,7 @@ function App() {
});
} else {
socket.emit("checkUserToken", {
token: getLocalStorage("auth"),
token: getLocalStorage("auth") || tokenParams,
shopId,
});
}
@@ -471,17 +475,6 @@ 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();
// // Navigate to the new cafeId while keeping existing params
// navigate(`/${user.cafeId}?${currentParams}`, { replace: true });
// }
// }, [user, shopId]);
function handleMoveToTransaction(direction, from) {
console.log(direction);
console.log(from);