• Dnyanesh Sable 10
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I have created one Aura component and I added beforeunload event in the init function so I am not able to catch beforunload event when I refresh the community page.
It is working in the normal salesforce page when Tab is getting close, the Browser is getting close and even refresh the page.
But when we use it in community page there is not working for a refresh. it is not a calling function.
Please can anyone help?
Thanks! 
 
doInit : function(component, event, helper) {       
        var closeCase = function(event){ 
             helper.handleCloseCase(component, event, helper);
         } 
         window.parent.addEventListener('unload', closeCase);
}