From fdd2e7f2e792d656251ec8b58c6e177c32f2a489 Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Thu, 21 Mar 2019 10:27:22 +0200 Subject: [PATCH] FIX: Do not update last seen notification ID when forced to enable 2FA." (#7222) --- .../discourse/widgets/user-notifications.js.es6 | 7 +++++-- config/locales/client.en.yml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/user-notifications.js.es6 b/app/assets/javascripts/discourse/widgets/user-notifications.js.es6 index 5e574553907..ee23fa894f0 100644 --- a/app/assets/javascripts/discourse/widgets/user-notifications.js.es6 +++ b/app/assets/javascripts/discourse/widgets/user-notifications.js.es6 @@ -34,9 +34,10 @@ export default createWidget("user-notifications", { limit = 40; } + const silent = this.currentUser.get("enforcedSecondFactor"); const stale = this.store.findStale( "notification", - { recent: true, limit }, + { recent: true, silent, limit }, { cacheKey: "recent-notifications" } ); @@ -59,7 +60,9 @@ export default createWidget("user-notifications", { stale .refresh() .then(notifications => { - this.currentUser.set("unread_notifications", 0); + if (!silent) { + this.currentUser.set("unread_notifications", 0); + } state.notifications = notifications; }) .catch(() => { diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 0e5285ff863..41049f3e4a7 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -803,7 +803,7 @@ en: label: "Code" rate_limit: "Please wait before trying another authentication code." enable_description: | - Scan this QR code in a supported app (AndroidiOS and enter your authentication code. + Scan this QR code in a supported app (AndroidiOS) and enter your authentication code. disable_description: "Please enter the authentication code from your app" show_key_description: "Enter manually" extended_description: |