Prevent redirect to topic details before topic create/update response arrives.
This commit is contained in:
parent
88cc301bb6
commit
6673bd53c4
2 changed files with 3 additions and 4 deletions
|
@ -110,8 +110,8 @@ const Edit: React.FC<Props> = ({
|
|||
});
|
||||
|
||||
const onSubmit = async (data: TopicFormData) => {
|
||||
setIsSubmitting(true);
|
||||
updateTopic(clusterName, data);
|
||||
setIsSubmitting(true); // Keep this action after updateTopic to prevent redirect before update.
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
@ -34,10 +34,9 @@ const New: React.FC<Props> = ({
|
|||
const onSubmit = async (data: TopicFormData) => {
|
||||
// TODO: need to fix loader. After success loading the first time, we won't wait for creation any more, because state is
|
||||
// loaded, and we will try to get entity immediately after pressing the button, and we will receive null
|
||||
// going to object page on the second creation. Resetting loaded state is workaround, need to tweak loader logic
|
||||
resetUploadedState();
|
||||
setIsSubmitting(true);
|
||||
// going to object page on the second creation. Setting of isSubmitting after createTopic is a workaround, need to tweak loader logic
|
||||
createTopic(clusterName, data);
|
||||
setIsSubmitting(true); // Keep this action after createTopic to prevent redirect before create.
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Reference in a new issue