Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
juskek committed Jul 6, 2023
1 parent 56d3e77 commit c6fe106
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion src/components/calculation-history/CalculationHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const CalculationHistory = ({
<p>
Specific Emissions: {calculation.specificEmissions}
</p>
{/* Render the selected countries */}
<ul>
{Array.from(calculation.selectedCountries).map(
([countryName, percentage]) => (
Expand Down
4 changes: 1 addition & 3 deletions src/data/calculations/CalculationsRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class CalculationsRepository implements ICalculationsRepository {
const data = await this.remoteDataSource.get({
ongoingCalculation: null,
});
console.log("data", data);

if (data["ongoingCalculation"] !== null) {
return JSON.parse(
data["ongoingCalculation"] as string
Expand All @@ -76,12 +76,10 @@ export class CalculationsRepository implements ICalculationsRepository {
try {
const ongoingCalculation = await this._getOngoingCalculation();
if (ongoingCalculation !== null) {
console.log("ongoingCalculation", ongoingCalculation);
return ongoingCalculation;
}
const oldCalculations = await this.getAllCalculations();
if (oldCalculations.length > 0) {
console.log("oldCalculations", oldCalculations);
return oldCalculations[0];
}
return null;
Expand Down

0 comments on commit c6fe106

Please sign in to comment.