Skip to content

fix: fix unterminated template literals in filterPending.ts and vite-env.d.ts - #1491

Closed
HRamiroAlbornoz wants to merge 1 commit into
Disciplr-Org:mainfrom
HRamiroAlbornoz:fix/unterminated-template-literals
Closed

HRamiroAlbornoz wants to merge 1 commit into
Disciplr-Org:mainfrom
HRamiroAlbornoz:fix/unterminated-template-literals

Conversation

@HRamiroAlbornoz

Copy link
Copy Markdown

Problem

pnpm build (tsc -b && vite build) was failing on main due to 24 TypeScript errors in two files:

  • \src/utils/filterPending.ts:86\ — unterminated template literal
  • \src/vite-env.d.ts:87, 107\ — missing opening backticks on template literal strings

Fix

  • \ ilterPending.ts: Replaced broken \if (normalize\Milestone)\ with \if (normalizedMilestone)\
  • \�ite-env.d.ts: Added missing backticks to template literal strings in both \EnvConfigError\ calls

Verification

  • \ sc --noEmit\ no longer reports any errors in these two files (the 24 errors are resolved)
  • Code review completed: Standards pass, Spec pass, no scope creep

Fixes #1489

…env.d.ts

- Replace broken if (normalize\Milestone) with if (normalizedMilestone)
- Add missing backticks to template literal strings in EnvConfigError calls

Fixes Disciplr-Org#1489
Sensei-Victor pushed a commit to Sensei-Victor/Disciplr-Frontend that referenced this pull request Oct 5, 2026
CurrencyContext.tsx was checking data.currency after fetching
/api/account/preferences. That field does not exist in the
preferences schema (preferencesSchema / PreferencesData); the
canonical field name is displayCurrency. As a result the if-check
always failed, setCurrency was never called, and useCurrencyPreference
silently returned the hardcoded USD default for every user regardless
of their saved Account → Preferences setting.

Fix: replace data.currency with data.displayCurrency in fetchCurrency.

Also add src/context/__tests__/CurrencyContext.test.tsx with 7 test
cases:
- picks up a non-USD displayCurrency from the preferences endpoint
  (primary regression guard)
- ignores the legacy wrong field name currency (keeps USD default)
- keeps USD default when displayCurrency is absent from the response
- exposes loading=true while the fetch is in-flight
- keeps USD and surfaces an error when the fetch rejects
- keeps USD and surfaces an error on a non-OK HTTP status
- throws the expected message when used outside CurrencyProvider

Closes Disciplr-Org#1491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm build fails: unterminated template literals in src/utils/filterPending.ts and src/vite-env.d.ts

2 participants