I'm wrapping an LWC within an aura component. The aura component will be called from a global action. By default, this opens the docked composer at the bottom of the screen. My aura component is intended to force the component to open in a full page and then close the docked composer.
In standard navigation apps, this works fine. In console apps, I'm seeing an infinite init occuring at the aura level. Specifically, I'm seeing the UID parameter infinitely increment. I have to close the browser tab or risk crashing the browser.
- I removed the LWC component but am still observing the infinite reloading on init.
- The same behavior happens when I use the workspace API
- I tried gating this behind a variable (initExecuted) and moving these actions to helpers, but no success.
- I did humor setting up a lightning component tab, but there is not a way to close the tab out when the form on the LWC is completed. This later causes some caching issues I'm still trying to solve for, which I'm assuming has something to do with the way the page is pushing from the docked composer to a full page.
I'm trying to narrow down why this is occurring as what my options are to still use the global action and push to the larger page. Ideally, I would just open the LWC from the global action, but that's not supported currently. My guess after looking at salesforce documentation & several stack exchange articles is that the workspace api & navigation services weren't intended for init? I'm not able to confirm this.
Can someone confirm why this is happening and what other options are there while keeping the global action (mandatory requirement).
MyAuraComponent.html:
<aura:component implements="flexipage:availableForAllPageTypes, force:lightningQuickActionWithoutHeader, lightning:isUrlAddressable" access="global" >
<lightning:workspaceAPI aura:id="workspace"/>
<lightning:navigation aura:id="navService"/>
<aura:attribute name="pageReference" type="Object"/>
<aura:attribute name="recordId" type="String"/>
<aura:attribute name="initExecuted" type="Boolean" default="false"/>
<aura:handler name="init" value="{!this}" action="{!c.doinit}" />
Open page!
</aura:component>
MyAuraComponent.js
doinit : function (component, event, helper) {
console.log('*** Aura init');
var initExecuted = component.get("v.initExecuted");
if(!initExecuted) {
component.set("v.initExecuted", true);
var pageRef = {
type: 'standard__component',
attributes: {
componentName: 'c__MyAuraComponent'
}
}
component.set("v.pageReference", pageRef);
var navService = component.find("navService");
navService.navigate(pageRef);
}
}