mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-08-09 18:32:44 +02:00
fix(web): resolve TDZ error on profile page from shadowed signal var
The profile page failed to render with "Cannot access 'h' before initialization". The /profile/me branch destructured `signal` from params and used it in the apiGet call, but later redeclared `const signal = ac.signal` in the same block scope. Block-scoped const hoisting put the earlier reference in the temporal dead zone. Drop the redundant inner declaration and pass `ac.signal` directly to the form submit listener. Fixes #233 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -167,7 +167,6 @@ ${flashHtml}
|
||||
</div>`, container);
|
||||
|
||||
const ac = new AbortController();
|
||||
const signal = ac.signal;
|
||||
|
||||
container.querySelector('#profile-form').addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
@@ -184,7 +183,7 @@ ${flashHtml}
|
||||
} catch (err) {
|
||||
router.navigate('/profile?error=' + encodeURIComponent(err.message), true);
|
||||
}
|
||||
}, { signal });
|
||||
}, { signal: ac.signal });
|
||||
|
||||
return () => ac.abort();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user