[SalesForce] Reload lightning component when clicking back from standard Opportunity Page

I have a lightning component in it's own page in Salesforce1 that allows me to click through to the standard Salesforce opportunity page.
(The component currently just shows basic Opportunity information.)

In the standard Opportunity page I can change values in the opportunity and save the new values. I then click the back button and Salesforce1 correctly navigates back to the lightning component.

The issue I seem to get a stale version of the Opportunity as the new values do not show on the component.

Is there way to refresh the component on navigating back?

I tried hooking in a doneRendering listener but that does not get called on the back navigation. Is there another event I can subscribe to within the lightning component?

Thanks

Best Answer

You could try firing force:refreshView during an aura:locationChange event. Add the locationChange handler to your component.

<aura:handler event="aura:locationChange" action="{!c.update}"/>

And handle the event in your JS code.

 update : function (component, event, helper) {
    // Get the new location token from the event if needed
    var loc = event.getParam("token");
     $A.get('e.force:refreshView').fire();
}

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_aura_locationChange.htm