Fix asset detail page visibility issue after update to v0.104.0#3365
Fix asset detail page visibility issue after update to v0.104.0#3365
Conversation
Co-authored-by: wcchung <12252921+wcchung@users.noreply.github.com>
Co-authored-by: wcchung <12252921+wcchung@users.noreply.github.com>
|
@copilot have you finish fixing the issue? |
Co-authored-by: wcchung <12252921+wcchung@users.noreply.github.com>
Yes, the fix is complete (commit Root cause: In Angular 18, the template conditions Fix (2 changes):
Lint passes ( |
Fixes a regression introduced in v0.104.0 (Angular 14→18 upgrade) where the asset detail page appeared blank after clicking any asset.
Root Cause
In
details.page.html, the*ngIfconditions used strict equality (=== true/=== false) against thengrxPushpipe output ofshowCaptureDetailsInIframe$. In Angular 18 with NgRx 18, when an observable hasn't emitted yet,ngrxPushreturnsundefined— meaning both conditions evaluate tofalse, so neither the Ionic nor iframe view component renders.showCaptureDetailsInIframe$depends on_activeDetailedCapture$(aReplaySubjectpopulated asynchronously after a database read), so the slide was blank on initial render.Changes Made
src/app/features/home/details/details.page.htmlReplaced the async
showCaptureDetailsInIframe$observable conditions with synchronous checks using the*ngForloop variable andnetworkConnected$(which emits immediately on subscription):*ngIf="!detailedCapture.id || (networkConnected$ | ngrxPush) !== true"— shows the Ionic view when the asset is not yet uploaded or the device is offline*ngIf="!!detailedCapture.id && (networkConnected$ | ngrxPush) === true"— shows the iframe view when the asset is uploaded and the device is onlinesrc/app/app-routing.module.tsAdded
paramsInheritanceStrategy: 'always'toRouterModule.forRootto ensure route params (type,hash) are correctly propagated to child routes in Angular 18.Testing
All files pass lintingOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.