Skip to content

Commit eda341d

Browse files
committed
chore: Simplify getIsNestedInAppLayout
1 parent 02e941e commit eda341d

File tree

1 file changed

+2
-3
lines changed
  • src/app-layout/visual-refresh-toolbar

1 file changed

+2
-3
lines changed

src/app-layout/visual-refresh-toolbar/index.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,12 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef<AppLayoutProps.Ref, AppLa
440440
* Does not apply to iframe
441441
*/
442442
const getIsNestedInAppLayout = (element: HTMLElement | null): boolean => {
443-
let currentElement: Element | null = element?.parentElement ?? null;
443+
const currentElement: Element | null = element?.parentElement ?? null;
444444

445-
while (currentElement) {
445+
if (currentElement) {
446446
if (getComputedStyle(currentElement).getPropertyValue(globalVars.stickyVerticalTopOffset)) {
447447
return true;
448448
}
449-
currentElement = currentElement.parentElement;
450449
}
451450

452451
return false;

0 commit comments

Comments
 (0)