Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because it fulfills the core functional requirements: you correctly create promise1 and promise2, resolve promise1 on .logo click, reject promise2 after 3 seconds, and append the proper success/error <div> elements to document.body using your helper. The overall structure is clean, and using { once: true } on the click listener is a nice touch to avoid multiple resolutions.
One medium-severity concern to be aware of: in src/scripts/main.js, the early return when .logo is not found means promise2 (and its timed rejection) may never be created in environments where the .logo element is missing. That can violate the requirement that promise2 must reject after 3 seconds regardless of the DOM state. To improve this, you can create promise2 before checking for .logo, or keep the .logo guard only around the click listener setup so promise2 is always instantiated. Aside from that edge case, your implementation matches the assignment’s behavioral expectations well. Nice work on organizing the DOM message creation into a reusable helper function.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| if (!logo) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
There is an early return when .logo is not found which prevents promise2 (and its handlers) from being created. This can violate the requirement that promise2 must be rejected in 3 seconds. Consider creating promise2 regardless of the presence of .logo, or move the promise2 setup before this return so the rejection still happens even when .logo is absent.
No description provided.