Skip to content

Commit

Permalink
Add conditional for old tableExport code to prevent double downloads …
Browse files Browse the repository at this point in the history
…when useNewTableExport feature toggle is on
  • Loading branch information
johnnadeluy committed Dec 18, 2024
1 parent 2ec2a6f commit 16c74f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/react4xp/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function Table(props: TableProps) {
}

function downloadTableAsExcel() {
if (window.downloadTableFile) {
if (window.downloadTableFile && !useNewTableExport) {
window.downloadTableFile(tableWrapperRef.current, {
type: 'xlsx',
fileName: 'tabell',
Expand All @@ -107,7 +107,7 @@ function Table(props: TableProps) {
},
})
}
if (useNewTableExport && tableRef?.current) {
if (tableRef?.current && useNewTableExport) {
exportTableToExcel({ tableElement: tableRef.current, fileName: displayName })
}
}
Expand Down

0 comments on commit 16c74f8

Please sign in to comment.