Fix JavaScript runtime errors for undefined name property access

- Add null checks to prevent "Cannot read properties of undefined (reading 'name')" errors
- Fix ProjectCard, MembersList, ProjectsView, DiscoverView, ProjectViewView components
- Add null validation in DIDView.claimDescription() and ClaimReportCertificateView.drawCanvas()
- Add missing databaseUtil import in MembersList component
- Use meaningful fallback text for undefined names ("Unnamed Project", "Unnamed Member")
- Resolves template rendering crashes when entities lack name properties
This commit is contained in:
Matthew Raymer
2025-07-05 05:38:20 +00:00
parent 1db420a066
commit 91a1618f40
8 changed files with 90 additions and 46 deletions

View File

@@ -60,17 +60,21 @@ export default class InfiniteScroll extends Vue {
* Used internally by Vue's lifecycle system
*/
updated() {
if (!this.observer) {
const options = {
root: null,
rootMargin: `0px 0px ${this.distance}px 0px`,
threshold: 1.0,
};
this.observer = new IntersectionObserver(
this.handleIntersection,
options,
);
this.observer.observe(this.$refs.sentinel as HTMLElement);
if (!this.observer && this.$refs.sentinel) {
const sentinelElement = this.$refs.sentinel as HTMLElement;
// Ensure we have a valid HTMLElement before observing
if (sentinelElement instanceof HTMLElement) {
const options = {
root: null,
rootMargin: `0px 0px ${this.distance}px 0px`,
threshold: 1.0,
};
this.observer = new IntersectionObserver(
this.handleIntersection,
options,
);
this.observer.observe(sentinelElement);
}
}
}