Skip to content

Commit 8dab7b4

Browse files
git checkout master -- static/app/views/issueDetails/groupDistributions/tagExportDropdown.tsx
1 parent ec87985 commit 8dab7b4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

static/app/views/issueDetails/groupDistributions/tagExportDropdown.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import {useState} from 'react';
2+
13
import {Button} from '@sentry/scraps/button';
24

5+
import {ExportQueryType, useDataExport} from 'sentry/components/dataExport';
36
import {DropdownMenu} from 'sentry/components/dropdownMenu';
4-
import {ExportQueryType, useDataExport} from 'sentry/components/useDataExport';
57
import {IconDownload} from 'sentry/icons';
68
import {t} from 'sentry/locale';
79
import type {Group} from 'sentry/types/group';
@@ -16,8 +18,9 @@ interface Props {
1618
}
1719

1820
export function TagExportDropdown({tagKey, group, organization, project}: Props) {
21+
const [isExportDisabled, setIsExportDisabled] = useState(false);
1922
const hasDiscoverQuery = organization.features.includes('discover-query');
20-
const {isExportWorking, runExport} = useDataExport({
23+
const handleDataExport = useDataExport({
2124
payload: {
2225
queryType: ExportQueryType.ISSUES_BY_TAG,
2326
queryInfo: {
@@ -54,11 +57,12 @@ export function TagExportDropdown({tagKey, group, organization, project}: Props)
5457
},
5558
{
5659
key: 'export-all',
57-
label: isExportWorking ? t('Export in progress...') : t('Export All to CSV'),
60+
label: isExportDisabled ? t('Export in progress...') : t('Export All to CSV'),
5861
onAction: () => {
59-
void runExport();
62+
handleDataExport();
63+
setIsExportDisabled(true);
6064
},
61-
disabled: isExportWorking || !hasDiscoverQuery,
65+
disabled: isExportDisabled || !hasDiscoverQuery,
6266
tooltip: hasDiscoverQuery
6367
? undefined
6468
: t('This feature is not available for your organization'),

0 commit comments

Comments
 (0)