Remove unnecessary early return in the RichTextWithButton component
MAILPOET-6431
This commit is contained in:
committed by
Oluwaseun Olorunsola
parent
ee513fd871
commit
f96e74cf96
@@ -18,7 +18,7 @@ type Replacement = {
|
||||
function getChildElement( rootElement: HTMLElement ): HTMLElement | null {
|
||||
let currentElement: HTMLElement | null = rootElement;
|
||||
|
||||
while ( currentElement && currentElement.children.length > 0 ) {
|
||||
while ( currentElement && currentElement?.children?.length > 0 ) {
|
||||
// Traverse into the first child element
|
||||
currentElement = currentElement.children[ 0 ] as HTMLElement;
|
||||
}
|
||||
|
@@ -97,13 +97,13 @@ export function RichTextWithButton( {
|
||||
</>
|
||||
);
|
||||
|
||||
if ( ! attributeValue ) {
|
||||
if ( ! attributeName ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<BaseControl
|
||||
id=""
|
||||
id="" // See https://github.com/mailpoet/mailpoet/pull/6089#discussion_r1952126850 to understand why the ID is empty
|
||||
label={ finalLabel }
|
||||
className={ `mailpoet-settings-panel__${ attributeName }-text` }
|
||||
help={ help }
|
||||
|
Reference in New Issue
Block a user