ok
This commit is contained in:
17
src/App.js
17
src/App.js
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user