Skip to content

Commit 393009f

Browse files
committed
fix(router): give list-pages the URL and title of a page only Ionic reports
list-pages took URLs and titles from the router, HTTP and component reports only, so a page reported only by the Ionic inspector showed neither. Each inspector's own url and title now fill in when those reports have none.
1 parent 484ce90 commit 393009f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎packages/devtools/src/devframe.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5025,11 +5025,18 @@ const pangular = defineDevframe({
50255025
platforms.set(page.pageId, `capacitor-${page.info.platform}`);
50265026
}
50275027
}
5028-
const withUrl = <T extends { pageId: string; reportedAt: number }>(pages: Iterable<T>) =>
5028+
const withUrl = <
5029+
T extends { pageId: string; reportedAt: number; url?: string; title?: string },
5030+
>(
5031+
pages: Iterable<T>,
5032+
) =>
50295033
[...pages].map((page) => ({
50305034
pageId: page.pageId,
50315035
// An idle page sends only its heartbeat, which counts as a report here.
50325036
reportedAt: Math.max(page.reportedAt, heartbeats.seenAt(page.pageId) ?? 0),
5037+
// A page only one inspector reports, such as Ionic, still names its own URL and title.
5038+
...(page.url !== undefined ? { url: page.url } : {}),
5039+
...(page.title !== undefined ? { title: page.title } : {}),
50335040
...details.get(page.pageId),
50345041
platform: platforms.get(page.pageId),
50355042
angular: angularPages.get(page.pageId)?.version,

0 commit comments

Comments
 (0)