diff --git a/packages/manager/.changeset/pr-11025-fixed-1727790118989.md b/packages/manager/.changeset/pr-11025-fixed-1727790118989.md new file mode 100644 index 00000000000..c8a6042a5d2 --- /dev/null +++ b/packages/manager/.changeset/pr-11025-fixed-1727790118989.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Fixed +--- + +Download Account Maintenance CSVs on the first attempt ([#11025](https://github.com/linode/manager/pull/11025)) diff --git a/packages/manager/src/features/Account/Maintenance/MaintenanceTable.tsx b/packages/manager/src/features/Account/Maintenance/MaintenanceTable.tsx index 91b33ffee0b..0bec6958632 100644 --- a/packages/manager/src/features/Account/Maintenance/MaintenanceTable.tsx +++ b/packages/manager/src/features/Account/Maintenance/MaintenanceTable.tsx @@ -1,5 +1,4 @@ /* eslint-disable jsx-a11y/anchor-is-valid */ -import { Theme } from '@mui/material/styles'; import * as React from 'react'; import { makeStyles } from 'tss-react/mui'; @@ -28,6 +27,7 @@ import { import { MaintenanceTableRow } from './MaintenanceTableRow'; import type { AccountMaintenance, Filter } from '@linode/api-v4'; +import type { Theme } from '@mui/material/styles'; const preferenceKey = 'account-maintenance'; @@ -136,7 +136,10 @@ const MaintenanceTable = ({ type }: Props) => { const downloadCSV = async () => { await getCSVData(); - csvRef.current.link.click(); + // This approach is not particularly elegant, but setTimeout may be the best way to make this click async without adding a lot of logic. + setTimeout(() => { + csvRef.current.link.click(); + }, 0); }; return (