Fix CategoryStep crashing non-499-A intake pages
CategoryStep script runs on ALL pages using the Wizard component. It tried to find #pw-wizard (its inner quiz div) and called querySelectorAll on it — null on CPNI/RMD/etc pages, crashing the entire script bundle. This prevented FRN auto-fill, officer suggestions, and all other intake functionality. Guard: if #pw-wizard doesn't exist, skip all CategoryStep logic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
acf63eb819
commit
dcdc6df879
1 changed files with 9 additions and 2 deletions
|
|
@ -173,8 +173,13 @@ import { LINE_105_CATALOG, LINE_105_BY_ID } from "../../../lib/line_105_catalog"
|
|||
import { LINE_105_CATALOG, LINE_105_BY_ID } from "../../../lib/line_105_catalog";
|
||||
|
||||
const err = document.getElementById("pw-cat-err") as HTMLDivElement;
|
||||
const wizard = document.getElementById("pw-wizard") as HTMLDivElement;
|
||||
const result = document.getElementById("pw-result") as HTMLDivElement;
|
||||
const wizard = document.getElementById("pw-wizard") as HTMLDivElement | null;
|
||||
const result = document.getElementById("pw-result") as HTMLDivElement | null;
|
||||
|
||||
// Guard: CategoryStep only runs on pages that have the category wizard
|
||||
if (!wizard) {
|
||||
// Not a 499-A page — skip all CategoryStep logic
|
||||
} else {
|
||||
|
||||
// Wizard state
|
||||
const answers: Record<string, string> = {};
|
||||
|
|
@ -469,4 +474,6 @@ import { LINE_105_CATALOG, LINE_105_BY_ID } from "../../../lib/line_105_catalog"
|
|||
}
|
||||
err.hidden = true;
|
||||
});
|
||||
|
||||
} // end of: if (!wizard) {} else {
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue