hmrc / hmrc-frontend

Apache License 2.0
9 stars 18 forks source link

Using the timeout dialog and clicking the Keep alive button generates a JS error #368

Closed AttendanceAllowanceTeam closed 3 months ago

AttendanceAllowanceTeam commented 3 months ago

I think specifically this happens when synchroniseTabs is undefined or false, and when initialising the app without sessionActivityService even though it doesn't need it.

My initialisation: if ($TimeoutDialog) { new TimeoutDialog($TimeoutDialog).init(); }

my njk template: {{ hmrcTimeoutDialog ({ timeout: timeoutDialog.timeout, countdown: timeoutDialog.countdown, keepAliveUrl: timeoutDialog.keepAliveUrl, signOutUrl: timeoutDialog.signOutUrl, timeoutUrl: timeoutDialog.timeoutUrl, title: t("timeout-modal:heading"), message: t("timeout-modal:message"), keepAliveButtonText: t("timeout-modal:keepAliveButtonText"), signOutButtonText: t("timeout-modal:deleteAnswersButtonText"), language: language, synchroniseTabs: false }) }}.

The Error:

`Uncaught TypeError: Cannot read properties of undefined (reading 'logActivity')
at HTMLButtonElement.keepAliveAndClose (timeout.js?20.8.0:1:6262)`