mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
hotfix: Don't handle git changes side effect too frequently (#8451)
This commit is contained in:
parent
0b897ff3dc
commit
8d0e5c6c34
@ -29,7 +29,7 @@ export const useGetGitChanges = () => {
|
||||
|
||||
// Latest changes should be on top
|
||||
React.useEffect(() => {
|
||||
if (result.data) {
|
||||
if (!result.isFetching && result.isSuccess && result.data) {
|
||||
const currentData = result.data;
|
||||
|
||||
// If this is new data (not the same reference as before)
|
||||
@ -59,7 +59,7 @@ export const useGetGitChanges = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [result.data]);
|
||||
}, [result.isFetching, result.isSuccess, result.data]);
|
||||
|
||||
return {
|
||||
data: orderedChanges,
|
||||
|
||||
@ -226,7 +226,7 @@ def zip_current_workspace(request: Request) -> FileResponse | JSONResponse:
|
||||
|
||||
@app.get(
|
||||
'/git/changes',
|
||||
response_model=dict[str, Any],
|
||||
response_model=list[dict[str, str]],
|
||||
responses={
|
||||
404: {'description': 'Not a git repository', 'model': dict},
|
||||
500: {'description': 'Error getting changes', 'model': dict},
|
||||
@ -236,7 +236,7 @@ async def git_changes(
|
||||
request: Request,
|
||||
conversation_id: str,
|
||||
user_id: str = Depends(get_user_id),
|
||||
) -> dict[str, Any] | JSONResponse:
|
||||
) -> list[dict[str, str]] | JSONResponse:
|
||||
runtime: Runtime = request.state.conversation.runtime
|
||||
conversation_store = await ConversationStoreImpl.get_instance(
|
||||
config,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user