FIX: currentUser might be undefined (#9555)

FIX: currentUser might be undefined (#9555)

diff --git a/app/assets/javascripts/discourse/app/components/site-header.js b/app/assets/javascripts/discourse/app/components/site-header.js
index 58219c1..e110b9c 100644
--- a/app/assets/javascripts/discourse/app/components/site-header.js
+++ b/app/assets/javascripts/discourse/app/components/site-header.js
@@ -215,8 +215,8 @@ const SiteHeaderComponent = MountWidget.extend(Docking, PanEvents, {
         if (
           !e.target.closest("#current-user") &&
           !e.target.closest(".ring-backdrop") &&
-          !this.currentUser.get("read_first_notification") &&
-          !this.currentUser.get("enforcedSecondFactor")
+          !this.get("currentUser.read_first_notification") &&
+          !this.get("currentUser.enforcedSecondFactor")
         ) {
           this.eventDispatched(
             "header:dismiss-first-notification-mask",
diff --git a/app/assets/javascripts/discourse/app/widgets/header.js b/app/assets/javascripts/discourse/app/widgets/header.js
index 65caab4..f2e80b8 100644
--- a/app/assets/javascripts/discourse/app/widgets/header.js
+++ b/app/assets/javascripts/discourse/app/widgets/header.js
@@ -539,7 +539,7 @@ export default createWidget("header", {
         "notification",
         {
           recent: true,
-          silent: this.currentUser.enforcedSecondFactor,
+          silent: this.get("currentUser.enforcedSecondFactor"),
           limit: 5
         },
         { cacheKey: "recent-notifications" }

GitHub sha: 23ff071e

This commit appears in #9555 which was merged by SamSaffron.