Skip to content

Commit

Permalink
Prevent stale content flash after editing request name
Browse files Browse the repository at this point in the history
  • Loading branch information
gschier committed Oct 15, 2024
1 parent 4acf096 commit a381e44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src-web/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,11 @@ function SidebarItem({
useScrollIntoView(ref.current, isActive);

const handleSubmitNameEdit = useCallback(
(el: HTMLInputElement) => {
async (el: HTMLInputElement) => {
if (itemModel === 'http_request') {
updateHttpRequest.mutate({ id: itemId, update: (r) => ({ ...r, name: el.value }) });
await updateHttpRequest.mutateAsync({ id: itemId, update: (r) => ({ ...r, name: el.value }) });
} else if (itemModel === 'grpc_request') {
updateGrpcRequest.mutate({ id: itemId, update: (r) => ({ ...r, name: el.value }) });
await updateGrpcRequest.mutateAsync({ id: itemId, update: (r) => ({ ...r, name: el.value }) });
}
setEditing(false);
},
Expand Down

0 comments on commit a381e44

Please sign in to comment.