-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Prevent blank order history page when using new tab component #19543
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,13 @@ import { | |
WindowRef, | ||
} from '@spartacus/core'; | ||
import { BehaviorSubject, combineLatest, Observable } from 'rxjs'; | ||
import { distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators'; | ||
import { | ||
distinctUntilChanged, | ||
map, | ||
startWith, | ||
switchMap, | ||
tap, | ||
} from 'rxjs/operators'; | ||
import { ComponentWrapperDirective } from '../../../cms-structure/page/component/component-wrapper.directive'; | ||
import { CmsComponentData } from '../../../cms-structure/page/model/index'; | ||
import { BREAKPOINT } from '../../../layout/config/layout-config'; | ||
|
@@ -144,7 +150,10 @@ export class TabParagraphContainerComponent implements AfterViewInit, OnInit { | |
} | ||
|
||
// Render the tabs after the templates have completed loading in the view. | ||
this.tabs$ = combineLatest([this.components$, this.tabRefs.changes]).pipe( | ||
this.tabs$ = combineLatest([ | ||
this.components$, | ||
this.tabRefs.changes.pipe(startWith(this.tabRefs)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After navigating to different route and back the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice find! Are we able to add an e2e test for the empty order history case just to make sure we have coverage? |
||
]).pipe( | ||
map(([components, refs]) => | ||
components.map((component, index) => ({ | ||
headerKey: component.title, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not directly related to the issue, but still its better to have this fix as soon as possible, since there is an error in console for b2b