Skip to content

[BUG] Redundant duplicate condition checks in NoteDetailPage #95

Description

@Pratyush-Panda-2006

Description
In
NoteDetailPage.jsx
, there are two consecutive conditional checks for if (!note). The first check immediately returns a simple "Note not found" string, rendering the second check (which contains the stylized card and "Back to Notes" home link) completely unreachable dead code.

Impact
Suboptimal Fallback UI: If a note fails to load, the user sees a raw text message instead of the stylized screen with a navigation link.
Code Maintenance Confusion: Dead code makes the codebase harder to maintain.
Location in Code
NoteDetailPage.jsx
:
javascript

if (!note) {
return (


Note not found



);
}
if (!note) {
return (

Note not found


Back to Notes

);
}

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions