-
Notifications
You must be signed in to change notification settings - Fork 62
[aca-4419] add new event once user is logged in #1105
Conversation
@@ -78,6 +90,10 @@ export class AlfrescoApi implements Emitter { | |||
this.oauth2Auth.setConfig(this.config, this); | |||
} | |||
|
|||
this.oauth2Auth?.on('logged-in', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By this time, can't we be sure, that we have this.oauth2Auth?
@@ -87,16 +103,23 @@ export class AlfrescoApi implements Emitter { | |||
this.processAuth.setConfig(this.config); | |||
} | |||
|
|||
this.processAuth?.on('logged-in', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By this time, can't we be sure, that we have this.processAuth?
if (!this.contentAuth) { | ||
this.contentAuth = new ContentAuth(this.config, this); | ||
} else { | ||
this.contentAuth.setConfig(config); | ||
} | ||
|
||
this.contentAuth?.on('logged-in', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By this time, can't we be sure, that we have this.contentAuth?
|
||
reply(event: string, callback ?: any): void { | ||
if (this.bufferEvents.indexOf(event) >= 0) { | ||
Function.prototype.apply.call(callback, this, arguments); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
callback?.apply(this, arguments)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this reply method for?
@@ -141,7 +141,7 @@ export class AlfrescoApiCompatibility extends AlfrescoApi { | |||
moduleCopy[currentClass] = module[currentClass]; | |||
let obj = this._stringToObject(currentClass, module); | |||
let nameObj = this._lowerFirst(currentClass); | |||
obj.init(this); | |||
obj?.init(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this, if 2 lines above, we explicitly assigned a value to this variable? Is the returned interface of _stringToObject amboguous?
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
add new event once user is logged in
What is the new behavior?
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: