This commit is contained in:
zadit
2024-12-13 21:29:10 +07:00
parent 198d0b3053
commit b88b9ce7ba
18 changed files with 195 additions and 66 deletions

View File

@@ -214,7 +214,10 @@ function App() {
let permission = Notification.permission;
// Check current permission
if (permission !== "granted") {
const searchParams = new URLSearchParams(location.search);
let searchModal = searchParams.get("modal") || ''; // Get transactionId or set it to empty string
if (permission !== "granted" && searchModal == '') {
setModal("req_notification");
}
};
@@ -315,6 +318,17 @@ 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);