From 1742f8cdbeb17c4e9f5bc79dd98d29c757606e7b Mon Sep 17 00:00:00 2001 From: prycey Date: Wed, 4 Jun 2025 19:30:27 -0700 Subject: [PATCH] fix: remove deprecated navigator.platform and unused variables - Remove deprecated navigator.platform API usage - Remove unused variables: browserLanguage, platform, timeZoneOffset - Clean up dead code in taxReturnCreate.ts and PreviewTaxReturns.tsx These variables were declared but never used in the request bodies, creating unnecessary code clutter. The navigator.platform API is also deprecated according to MDN documentation. This change improves code maintainability and eliminates deprecation warnings without affecting functionality. --- .../df-client-app/src/auth/Account/PreviewTaxReturns.tsx | 4 ---- .../src/redux/slices/tax-return/taxReturnCreate.ts | 4 ---- 2 files changed, 8 deletions(-) diff --git a/direct-file/df-client/df-client-app/src/auth/Account/PreviewTaxReturns.tsx b/direct-file/df-client/df-client-app/src/auth/Account/PreviewTaxReturns.tsx index 301e4ad..e51971f 100644 --- a/direct-file/df-client/df-client-app/src/auth/Account/PreviewTaxReturns.tsx +++ b/direct-file/df-client/df-client-app/src/auth/Account/PreviewTaxReturns.tsx @@ -22,10 +22,6 @@ const PreviewTaxReturns = () => { const handlePreview = useCallback(async () => { const url = `${import.meta.env.VITE_BACKEND_URL}v1/taxreturns/${currentTaxReturnId}/preview`; const alertKey = SystemAlertKey.PREVIEW; - const browserLanguage: string = navigator.language; - // TODO: navigator.platform is deprecated: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform - const platform: string = navigator.platform ? navigator.platform : ``; - const timeZoneOffset: number = new Date().getTimezoneOffset(); const facts = JSON.parse(factGraph.toJSON()); try { diff --git a/direct-file/df-client/df-client-app/src/redux/slices/tax-return/taxReturnCreate.ts b/direct-file/df-client/df-client-app/src/redux/slices/tax-return/taxReturnCreate.ts index a339a54..67472c0 100644 --- a/direct-file/df-client/df-client-app/src/redux/slices/tax-return/taxReturnCreate.ts +++ b/direct-file/df-client/df-client-app/src/redux/slices/tax-return/taxReturnCreate.ts @@ -10,10 +10,6 @@ import { TaxReturn } from '../../../types/core.js'; * then trigger any logging on this fetch. */ export async function taxReturnCreate(): Promise { - const browserLanguage: string = navigator.language; - // TODO: navigator.platform is deprecated: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform - const platform: string = navigator.platform ? navigator.platform : ``; - const timeZoneOffset: number = new Date().getTimezoneOffset(); const year = Number.parseInt(CURRENT_TAX_YEAR); return await save(`${import.meta.env.VITE_BACKEND_URL}v1/taxreturns`, {