Summarize into new chat suggested action (#34)

This commit is contained in:
Will Chen
2025-04-28 16:14:12 -07:00
committed by GitHub
parent 0d441b15ca
commit 9fb5439ecf
8 changed files with 189 additions and 48 deletions

View File

@@ -7,7 +7,6 @@ export function useProposal(chatId?: number | undefined) {
const [proposalResult, setProposalResult] = useAtom(proposalResultAtom);
const [isLoading, setIsLoading] = useState<boolean>(false);
const [error, setError] = useState<string | null>(null);
const fetchProposal = useCallback(
async (overrideChatId?: number) => {
chatId = overrideChatId ?? chatId;
@@ -19,7 +18,6 @@ export function useProposal(chatId?: number | undefined) {
}
setIsLoading(true);
setError(null);
setProposalResult(null); // Reset on new fetch
try {
// Type assertion might be needed depending on how IpcClient is typed
const result = (await IpcClient.getInstance().getProposal(
@@ -39,7 +37,7 @@ export function useProposal(chatId?: number | undefined) {
setIsLoading(false);
}
},
[chatId]
[chatId] // Only depend on chatId, setProposalResult is stable
); // Depend on chatId
useEffect(() => {