From 348fea6a42981ad6fd8cc98c14ba0f55e9850bc1 Mon Sep 17 00:00:00 2001 From: Christophe Bliard Date: Thu, 12 Sep 2024 11:49:08 +0200 Subject: [PATCH] Check if warning should be displayed on connect This is to display the warning when the user changes the calculation mode and then reloads the page, or when the user changes the calculation mode, navigates away and then goes back to the settings page. --- .../controllers/dynamic/admin/progress-tracking.controller.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/stimulus/controllers/dynamic/admin/progress-tracking.controller.ts b/frontend/src/stimulus/controllers/dynamic/admin/progress-tracking.controller.ts index 05f3b5f97b63..5047fe4f6dd2 100644 --- a/frontend/src/stimulus/controllers/dynamic/admin/progress-tracking.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/admin/progress-tracking.controller.ts @@ -49,6 +49,10 @@ export default class ProgressTrackingController extends Controller { declare readonly warningTextTarget:HTMLElement; declare readonly warningToastTarget:HTMLElement; + connect() { + this.displayWarning(); + } + displayWarning() { const warningMessageHtml = this.getWarningMessageHtml(); if (warningMessageHtml) {