From 23ff071ebda928a763650d0a751d7c833ee1d2bc Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 28 Apr 2020 07:55:06 +0200 Subject: [PATCH] FIX: currentUser might be undefined (#9555) --- .../javascripts/discourse/app/components/site-header.js | 4 ++-- app/assets/javascripts/discourse/app/widgets/header.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/site-header.js b/app/assets/javascripts/discourse/app/components/site-header.js index 58219c1dda0..e110b9ceeea 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 65caab48103..f2e80b8dae5 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" }