From d45182b38252f92032f785a9b49328d3876cdd8b Mon Sep 17 00:00:00 2001 From: sauls8t Date: Sat, 24 Mar 2018 13:27:39 +0000 Subject: [PATCH] Exclude anonymous users from What's New No need to notifiy anon users of product updates. --- gui/app/services/session.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gui/app/services/session.js b/gui/app/services/session.js index d8cafb85..a5285ef4 100644 --- a/gui/app/services/session.js +++ b/gui/app/services/session.js @@ -79,6 +79,9 @@ export default SimpleAuthSession.extend({ }, seenNewVersion() { + // Anonymous users are not shown "What's New" notifications. + if (!this.get('authenticated') || this.get('user.id') === this.get('constants.EveryoneUserId')) return; + this.get('userSvc').getUser(this.get('user.id')).then((user) => { user.set('lastVersion', this.get('appMeta.version')); this.get('userSvc').save(user); @@ -88,6 +91,9 @@ export default SimpleAuthSession.extend({ // set what's new indicator hasWhatsNew() { return new EmberPromise((resolve) => { + // Anonymous users are not shown "What's New" notifications. + if (!this.get('authenticated') || this.get('user.id') === this.get('constants.EveryoneUserId')) return false; + return this.get('userSvc').getUser(this.get('user.id')).then((user) => { let isNew = miscUtil.isNewVersion(user.get('lastVersion'), this.get('appMeta.version'), false); resolve(isNew);