This commit is contained in:
zadit
2025-01-21 07:41:46 +07:00
parent 308eafa6d4
commit e0ef8d5023
7 changed files with 371 additions and 63 deletions

View File

@@ -413,27 +413,27 @@ function App() {
setModalContent(content)
};
// Function to close the modal
const closeModal = (closeTheseContent = []) => {
if (
Array.isArray(closeTheseContent) &&
(closeTheseContent.length === 0 ||
closeTheseContent.includes(modalContent))
(closeTheseContent.length === 0 || closeTheseContent.includes(modalContent))
) {
setIsModalOpen(false);
setModalContent(null);
document.body.style.overflow = "auto";
const queryParams = new URLSearchParams(location.search);
// Remove the 'modal' parameter
queryParams.delete("modal");
queryParams.delete("transactionId");
// Update the URL without the 'modal' parameter
// Clear all query parameters
queryParams.keys() && [...queryParams.keys()].forEach(key => {
queryParams.delete(key);
});
// Update the URL without any query parameters
navigate({ search: queryParams.toString() }, { replace: true });
}
};
// useEffect(() => {
// const askNotificationPermission = async () => {