diff --git a/cypress/e2e/registration.cy.ts b/cypress/e2e/registration.cy.ts index 1f1b4a585..6ee145ca0 100644 --- a/cypress/e2e/registration.cy.ts +++ b/cypress/e2e/registration.cy.ts @@ -81,6 +81,7 @@ describe('registration', () => { // `Uncaught ReferenceError: setVisitorCookieTimeout is not defined` // and causes Cypress to fail the test. // As this is outside of our control, we ignore this specific error for now. + // Update (2024-01-10): The page is now re-redirected to 'https://www.u25-deutschland.de/helpmail/' cy.on('uncaught:exception', (error) => { if ( error.message.includes( @@ -92,7 +93,10 @@ describe('registration', () => { }); cy.visit('/u25/registration'); cy.wait('@consultingTypeServiceBySlugFull'); - cy.url().should('be.equal', 'https://www.u25.de/helpmail/'); + cy.url().should( + 'be.equal', + 'https://www.u25-deutschland.de/helpmail/' + ); }); it('should have all generic registration page elements', () => { diff --git a/cypress/fixtures/service.consultingtypes.u25.json b/cypress/fixtures/service.consultingtypes.u25.json index 5cb91e91b..4649c0e3b 100644 --- a/cypress/fixtures/service.consultingtypes.u25.json +++ b/cypress/fixtures/service.consultingtypes.u25.json @@ -8,7 +8,7 @@ "registrationDropdown": "Beratung für suizidgefährdete junge Menschen [U25]" }, "urls": { - "requiredAidMissingRedirectUrl": "https://www.u25.de/helpmail/" + "requiredAidMissingRedirectUrl": "https://www.u25-deutschland.de/helpmail/" }, "registration": { "minPostcodeSize": 5, diff --git a/src/containers/bookings/components/Booking/booking.tsx b/src/containers/bookings/components/Booking/booking.tsx index 01096734c..1eb6def10 100644 --- a/src/containers/bookings/components/Booking/booking.tsx +++ b/src/containers/bookings/components/Booking/booking.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { useContext, useEffect, useState } from 'react'; import { ListItemInterface, + STATUS_EMPTY, UserDataContext, UserDataInterface } from '../../../../globalState'; @@ -45,6 +46,8 @@ export const Booking = () => { }); }, [userData]); + if (!session) return null; + return ( {appointmentLink && settings.calcomUrl && ( @@ -58,8 +61,7 @@ export const Booking = () => { 'metadata[user]': userData.userId, 'metadata[isInitialAppointment]': !session.consultant || - new Date(session.latestMessage).getTime() < - new Date(session.session.createDate).getTime(), + session.session.status === STATUS_EMPTY, 'metadata[sessionId]': session.session.id, 'metadata[rcToken]': getValueFromCookie('rc_token'), 'metadata[rcUserId]': getValueFromCookie('rc_uid'),