mirror of
https://github.com/documize/community.git
synced 2025-07-25 16:19:46 +02:00
Exclude anonymous users from What's New
No need to notifiy anon users of product updates.
This commit is contained in:
parent
8077dd939a
commit
d45182b382
1 changed files with 6 additions and 0 deletions
|
@ -79,6 +79,9 @@ export default SimpleAuthSession.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
seenNewVersion() {
|
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) => {
|
this.get('userSvc').getUser(this.get('user.id')).then((user) => {
|
||||||
user.set('lastVersion', this.get('appMeta.version'));
|
user.set('lastVersion', this.get('appMeta.version'));
|
||||||
this.get('userSvc').save(user);
|
this.get('userSvc').save(user);
|
||||||
|
@ -88,6 +91,9 @@ export default SimpleAuthSession.extend({
|
||||||
// set what's new indicator
|
// set what's new indicator
|
||||||
hasWhatsNew() {
|
hasWhatsNew() {
|
||||||
return new EmberPromise((resolve) => {
|
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) => {
|
return this.get('userSvc').getUser(this.get('user.id')).then((user) => {
|
||||||
let isNew = miscUtil.isNewVersion(user.get('lastVersion'), this.get('appMeta.version'), false);
|
let isNew = miscUtil.isNewVersion(user.get('lastVersion'), this.get('appMeta.version'), false);
|
||||||
resolve(isNew);
|
resolve(isNew);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue