From 3e2cf1d69c934d266428ced6b4876d13ef1ac4e6 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 13 Jul 2021 15:33:50 +0300 Subject: [PATCH] Island: refactor RansomwareReport.js to not use the props in state initialization --- .../report-components/RansomwareReport.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js b/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js index 4dd4b6f39..adda1f2e0 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js @@ -9,28 +9,15 @@ import '../../styles/pages/report/RansomwareReport.scss'; class RansomwareReport extends React.Component { - constructor(props) { - super(props); - this.state = { - report: props.report - }; - } - - componentDidUpdate(prevProps) { - if (this.props.report !== prevProps.report) { - this.setState({report: this.props.report}) - } - } - stillLoadingDataFromServer() { - return Object.keys(this.state.report).length === 0; + return Object.keys(this.props.report).length === 0; } generateReportContent() { return (
{this.getExploitationStats()} - +
) }