Skip to content

Commit

Permalink
fix: [M3-8391] - Account maintenance CSV download in the first attempt (
Browse files Browse the repository at this point in the history
#11025)

* fix: [M3-8391] - Account maintenance CSV download in the first attempt

* Added changeset: Download Account Maintenance CSVs on the first attempt

* fix: [M3-8392] - explanatory comment
  • Loading branch information
harsh-akamai authored Oct 3, 2024
1 parent 1c6241d commit e8c0ed4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11025-fixed-1727790118989.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Download Account Maintenance CSVs on the first attempt ([#11025](https://github.com/linode/manager/pull/11025))
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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';

Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit e8c0ed4

Please sign in to comment.