Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ export const SecurityAnalysisExportButton: FunctionComponent<SecurityAnalysisExp
setIsCsvExportSuccessful(false);
}, [nodeUuid, resultType]);

useEffect(() => {
if (disabled) {
// reinit the success state when the button is disabled,
// for example when the calcul status change or results change
setIsCsvExportSuccessful(false);
}
}, [disabled]);

const enumValueTranslations = useMemo(() => {
const returnedValue: Record<string, string> = {
[PERMANENT_LIMIT_NAME]: intl.formatMessage({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { SyntheticEvent, useCallback, useMemo, useState } from 'react';
import { SyntheticEvent, useCallback, useEffect, useMemo, useState } from 'react';
import { Box, LinearProgress, Tab, Tabs } from '@mui/material';
import SensitivityAnalysisTabs from './sensitivity-analysis-tabs.js';
import PagedSensitivityAnalysisResult from './paged-sensitivity-analysis-result';
Expand Down Expand Up @@ -177,6 +177,14 @@ function SensitivityAnalysisResultTab({
[voltageLevelsFilter, countriesFilter, propertiesFilter]
);

useEffect(() => {
if (isCsvButtonDisabled) {
// reinit the success state when the button is disabled,
// for example when the calcul status change or results change
setIsCsvExportSuccessful(false);
}
}, [isCsvButtonDisabled]);

return (
<>
<SensitivityAnalysisTabs sensiTab={sensiTab} setSensiTab={handleSensiTabChange} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ export const ShortCircuitExportButton: FunctionComponent<ShortCircuitExportButto
setIsCsvExportSuccessful(false);
}, [nodeUuid, analysisType]);

useEffect(() => {
if (disabled) {
// reinit the success state when the button is disabled,
// for example when the calcul status change or results change
setIsCsvExportSuccessful(false);
}
}, [disabled]);

const enumValueTranslations = useMemo(() => {
const returnedValue: Record<string, string> = {};
const enumValuesToTranslate = [
Expand Down
Loading