Skip to content

Commit

Permalink
Make suggestions show up
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscariremma committed Sep 27, 2024
1 parent 348dc08 commit 4a838bc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/components/Suggestions.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { useState } from "react";
import {useEffect, useState} from "react";
import { Suggestion, SuggestionWithState } from "../lib/goldapps/types";
import { commitSuggestions } from "../lib/goldapps/commit-suggestions";
import { SuggestionsTable } from "./SuggestionsTable";
Expand All @@ -18,6 +18,12 @@ export const Suggestions = ({ suggestions: serverSuggestions }: Props) => {
})),
);

useEffect(() => { setSuggestions( serverSuggestions.map(suggestion => ({
...suggestion,
selected: false,
error: null,
}))) }, [serverSuggestions]);

const onCommit = async () => {
// Sending each change as a separate request allows us to show on which ones
// the errors occur
Expand Down

0 comments on commit 4a838bc

Please sign in to comment.