Skip to content

Commit

Permalink
Rename ProblemTypeSolutionId to SolutionIds
Browse files Browse the repository at this point in the history
  • Loading branch information
Elscrux committed Jan 23, 2024
1 parent 3be04be commit 53e60be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/solvers/HistoryStorage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProblemTypeSolutionId } from "./ProgressHandler";
import { SolutionIds } from "./ProgressHandler";

export interface ProblemState<T> {
/**
Expand All @@ -8,7 +8,7 @@ export interface ProblemState<T> {
/**
* Ids of the solutions of the problem input per problem type
*/
solutionIds: ProblemTypeSolutionId;
solutionIds: SolutionIds;
}

export function getHistory<T>(problemTypes: string[]): ProblemState<T>[] {
Expand Down
6 changes: 3 additions & 3 deletions src/components/solvers/ProgressHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getHistory, ProblemState, storeHistory } from "./HistoryStorage";
import { SolutionView } from "./SolutionView";
import { SolverPicker } from "./SolverPicker";

export type ProblemTypeSolutionId = {
export type SolutionIds = {
[problemTypeId: string]: number;
};

Expand Down Expand Up @@ -70,7 +70,7 @@ export const ProgressHandler = <T extends {}>(
let solutionIdMap = result.reduce((acc, item) => {
acc[item.problemType] = item.solution.id;
return acc;
}, {} as ProblemTypeSolutionId);
}, {} as SolutionIds);

let newProblemState: ProblemState<T> = {
problemInput: props.problemInput,
Expand All @@ -83,7 +83,7 @@ export const ProgressHandler = <T extends {}>(
});
}

async function loadSolution(ids: ProblemTypeSolutionId) {
async function loadSolution(ids: SolutionIds) {
setClicked(true);
setFinished(false);

Expand Down

0 comments on commit 53e60be

Please sign in to comment.