File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed
Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export type ReplayLoadingDetail =
1919 | { loading : false ; replayNotFoundError : boolean } ;
2020
2121export type RwpPageLoadingEvent = CustomEvent <
22- EmbedReplayData & {
22+ Required < Pick < EmbedReplayData , "url" | "ts" > > & {
2323 type : "page-loading" ;
2424 } & ReplayLoadingDetail
2525> ;
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ import { ifDefined } from "lit/directives/if-defined.js";
5858import "./item-info" ;
5959import { dateTimeFormatter } from "./utils/dateTimeFormatter" ;
6060import type {
61+ ReplayLoadingDetail ,
6162 RwpPageLoadingEvent ,
6263 RwpUrlChangeEvent ,
6364 TabNavEvent ,
@@ -1781,20 +1782,25 @@ class Item extends LitElement {
17811782 ) {
17821783 const { loading, replayNotFoundError } = event . detail ;
17831784 if ( this . embed && window . parent !== window && this . isLoading !== loading ) {
1784- let msg : RwpPageLoadingEvent [ "detail" ] ;
1785+ let loadingDetail : ReplayLoadingDetail ;
17851786
17861787 if ( loading ) {
1787- msg = {
1788- type : "page-loading" ,
1788+ loadingDetail = {
17891789 loading,
17901790 } ;
17911791 } else {
1792- msg = {
1793- type : "page-loading" ,
1792+ loadingDetail = {
17941793 loading,
17951794 replayNotFoundError : replayNotFoundError ?? false ,
17961795 } ;
17971796 }
1797+ const msg = {
1798+ ...loadingDetail ,
1799+ type : "page-loading" ,
1800+ url : this . tabData . url ?? "" ,
1801+ ts : this . tabData . ts ?? "" ,
1802+ } satisfies RwpPageLoadingEvent [ "detail" ] ;
1803+
17981804 window . parent . postMessage ( msg , "*" ) ;
17991805 }
18001806 this . isLoading = loading ;
Original file line number Diff line number Diff line change @@ -318,7 +318,9 @@ class Replay extends LitElement {
318318 this . clearHilite ( true ) ;
319319 this . dispatchEvent (
320320 new CustomEvent < ReplayLoadingDetail > ( "replay-loading" , {
321- detail : { loading : true } ,
321+ detail : {
322+ loading : true ,
323+ } ,
322324 } ) ,
323325 ) ;
324326 }
You can’t perform that action at this time.
0 commit comments