Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Panico committed May 13, 2024
1 parent 0cf0f43 commit a99d3ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,6 @@ export class AppComponent implements OnInit {
this.SUPPORT_MODE = this.g.supportMode
}

this.triggerOnBeforeInit('onBeforeInit')

});
this.globalSettingsService.initParamiters(this.g, this.el);

Expand Down Expand Up @@ -322,7 +320,8 @@ export class AppComponent implements OnInit {
this.loadCustomScript(appconfig)
this.listenToPostMsgs();

this.loadStyle(JSON.parse(localStorage.getItem('custom_style')))
this.loadStyle(JSON.parse(localStorage.getItem('custom_style')));
this.triggerOnInit('onInit')
}


Expand Down Expand Up @@ -1675,9 +1674,9 @@ export class AppComponent implements OnInit {
this.triggerEvents.triggerOnAuthStateChanged(detailOBJ)
}

private triggerOnBeforeInit(event){
private triggerOnInit(event){
const detailOBJ = { event: event, isLogged: true, user: this.tiledeskAuthService.getCurrentUser() }
this.triggerEvents.triggerOnBeforeInit(detailOBJ)
this.triggerEvents.triggerOnInit(detailOBJ)
}


Expand Down
1 change: 0 additions & 1 deletion src/app/components/sidebar/sidebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export class SidebarComponent implements OnInit {
this.tiledesk_url = BRAND_BASE_INFO['COMPANY_SITE_URL'] as string

this.DASHBOARD_URL = this.appConfig.getConfig().dashboardUrl + '#/project/';
console.log('[SIDEBAR] DASHBOARD_URL ', this.DASHBOARD_URL, LOGOS_ITEMS)
this.getStoredProjectAndUserRole()
this.subcribeToAuthStateChanged()
this.listenTocurrentProjectUserUserAvailability$()
Expand Down
8 changes: 4 additions & 4 deletions src/app/services/triggerEvents/triggerEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ export class TriggerEvents {

}

public triggerOnBeforeInit(detailObj: {}) {
this.logger.debug(' ---------------- triggerOnBeforeInitEvent ---------------- ', detailObj);
public triggerOnInit(detailObj: {}) {
this.logger.debug(' ---------------- triggerOnInitEvent ---------------- ', detailObj);
try {
const onBeforeInit = new CustomEvent('onBeforeInit', { detail: detailObj });
const onBeforeInit = new CustomEvent('onInit', { detail: detailObj });
const windowContext = this.windowContext;
if (windowContext){
// windowContext.document.dispatchEvent(onNewConversation);
windowContext.postMessage({type: "onBeforeInit", detail: detailObj }, '*')
windowContext.postMessage({type: "onInit", detail: detailObj }, '*')
}
} catch (e) {
this.logger.error('[TRIGGER-HANDLER] > Error:' + e);
Expand Down

0 comments on commit a99d3ef

Please sign in to comment.