diff --git a/src/core/api.js b/src/core/api.js index 53be160f..a8748957 100644 --- a/src/core/api.js +++ b/src/core/api.js @@ -614,13 +614,13 @@ const retrieveState = () => { * and calculate acceptType */ if (!state._invalidConsent) { - state._enabledServices = {...state._acceptedServices}; - state._acceptedServices = { ...state._acceptedServices, ...services }; + state._enabledServices = {...state._acceptedServices}; + setAcceptedCategories([ ...state._readOnlyCategories, ...categories diff --git a/src/utils/cookies.js b/src/utils/cookies.js index 63efe2ff..ea712c1f 100644 --- a/src/utils/cookies.js +++ b/src/utils/cookies.js @@ -168,6 +168,10 @@ export const saveCookiePreferences = () => { consentId: state._consentId, services: deepCopy(state._acceptedServices) }; + + if (state._lastConsentTimestamp) { + state._savedCookieContent.lastConsentTimestamp = state._lastConsentTimestamp.toISOString(); + } let isFirstConsent = false; const stateChanged = categoriesWereChanged || servicesWereChanged;