diff --git a/frontend/src/components/Suggestions.tsx b/frontend/src/components/Suggestions.tsx index 420b2c8..e4f3486 100644 --- a/frontend/src/components/Suggestions.tsx +++ b/frontend/src/components/Suggestions.tsx @@ -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"; @@ -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