Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/same device #13

Merged

Conversation

SmirlakisParis
Copy link
Contributor

issue verification for same device

Copy link

sonarcloud bot commented Sep 23, 2024

@SmirlakisParis SmirlakisParis merged commit 49facaa into eu-digital-identity-wallet:main Sep 23, 2024
2 of 3 checks passed
@SmirlakisParis SmirlakisParis deleted the feat/same-device branch September 23, 2024 09:06
src/server/services/BookingService.ts Show resolved Hide resolved
src/pages/confirmation/[id].tsx Show resolved Hide resolved
src/pages/confirmation/[id].tsx Show resolved Hide resolved
const deviceType = useAppStore((state) => state.deviceType);

const onSubmit = async (data: BookingDto) => {
console.log(data);
await createBookingAsync(data);
};

// Watch for changes in bookingCreateRes
useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simplified as:

useEffect(() => {
  if (bookingCreateRes?.url) {
    deviceType === 'desktop' ? changeModalStatus(ModalStatus.OPEN) : (window.location.href = bookingCreateRes.url);
  }
}, [bookingCreateRes?.url, deviceType, changeModalStatus]);

@@ -24,7 +24,7 @@ const ConfirmationDetails = ({
reservationDate,
} = details;
const { isLoading, issueConfirmationAsync } = useBookingStore();

console.log(id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot this console.log?

src/server/services/BookingService.ts Show resolved Hide resolved
router.push(PATHS.confirmation(bookingId)); // Navigate to confirmation page
}

// Timeout logic to stop polling after 30 seconds
const timeout = setTimeout(() => {
stopPolling(); // Stop polling after 30 seconds
}, 30000);
}, 60000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be an env var

@@ -36,14 +36,15 @@ export const useBookingVerify = () => {
const { data, error } = useSWR(
bookingId,
fetcher,
{ refreshInterval: polling ? 1000 : 0 } // Poll every second if polling is true
{ refreshInterval: polling ? 3000 : 0 } // Poll every second if polling is true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be an env var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants