From 8dc83a3443d9304aab0ff2d4d4af6fe06ae15a3f Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Sun, 18 Feb 2024 12:14:13 -0500 Subject: [PATCH] fix: wrong conditions for decorators in gas estimation --- toolchains/solidity/extension/src/gas-estimation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchains/solidity/extension/src/gas-estimation.ts b/toolchains/solidity/extension/src/gas-estimation.ts index 7c5d214a..132675e0 100644 --- a/toolchains/solidity/extension/src/gas-estimation.ts +++ b/toolchains/solidity/extension/src/gas-estimation.ts @@ -269,12 +269,12 @@ async function showReport(editor: vscode.TextEditor, reports: ReportDecorators, let report = reports.get(editor.document.uri.path); const reportSaved = reportsSaved.get(editor.document.uri.path); - if (!report || !reportSaved) { + if (!report && !reportSaved) { } else if (report && !reportSaved) { editor.setDecorations(decorationType, report); } else if (!report && reportSaved) { editor.setDecorations(decorationType, reportSaved); - } else { + } else if (report && reportSaved) { report = report.filter((reportElement) => { return !reportSaved.some((reportSavedElement) => { return reportElement.range.isEqual(reportSavedElement.range);