fix: fetching reflection adds draft state in gRPC (#6218)

This commit is contained in:
sanish chirayath
2025-11-26 19:51:34 +05:30
committed by GitHub
parent ca8ef36f9f
commit 486b91894c

View File

@@ -129,11 +129,15 @@ const GrpcQueryUrl = ({ item, collection, handleRun }) => {
setProtoFilePath('');
setIsReflectionMode(true);
dispatch(updateRequestProtoPath({
protoPath: '',
itemUid: item.uid,
collectionUid: collection.uid
}));
// Only update protoPath if it was previously set (to avoid creating unnecessary draft state)
const currentProtoPath = getPropertyFromDraftOrRequest(item, 'request.protoPath', '');
if (currentProtoPath) {
dispatch(updateRequestProtoPath({
protoPath: '',
itemUid: item.uid,
collectionUid: collection.uid
}));
}
if (methods && methods.length > 0) {
toast.success(`Loaded ${methods.length} gRPC methods from reflection`);