Redirect right after a message is sent (#831)

This commit is contained in:
Alexander Krivonosov 2021-08-30 12:50:42 +03:00 committed by GitHub
parent 1b2b22f18a
commit de33c13dc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 15 deletions

View file

@ -25,7 +25,6 @@ export interface Props {
) => void;
messageSchema: TopicMessageSchema | undefined;
schemaIsFetched: boolean;
messageIsSent: boolean;
messageIsSending: boolean;
partitions: Partition[];
}
@ -37,7 +36,6 @@ const SendMessage: React.FC<Props> = ({
sendTopicMessage,
messageSchema,
schemaIsFetched,
messageIsSent,
messageIsSending,
partitions,
}) => {
@ -81,11 +79,6 @@ const SendMessage: React.FC<Props> = ({
}
}
}, [schemaIsFetched]);
React.useEffect(() => {
if (messageIsSent) {
history.push(clusterTopicMessagesPath(clusterName, topicName));
}
}, [messageIsSent]);
const onSubmit = async (data: {
key: string;
@ -112,6 +105,7 @@ const SendMessage: React.FC<Props> = ({
headers,
partition,
});
history.push(clusterTopicMessagesPath(clusterName, topicName));
}
}
};

View file

@ -7,7 +7,6 @@ import {
getPartitionsByTopicName,
getTopicMessageSchemaFetched,
getTopicMessageSending,
getTopicMessageSent,
} from 'redux/reducers/topics/selectors';
import SendMessage from './SendMessage';
@ -31,7 +30,6 @@ const mapStateToProps = (
topicName,
messageSchema: getMessageSchemaByTopicName(state, topicName),
schemaIsFetched: getTopicMessageSchemaFetched(state),
messageIsSent: getTopicMessageSent(state),
messageIsSending: getTopicMessageSending(state),
partitions: getPartitionsByTopicName(state, topicName),
});

View file

@ -72,7 +72,6 @@ const setupWrapper = (props?: Partial<Props>) => (
},
}}
schemaIsFetched={false}
messageIsSent={false}
messageIsSending={false}
partitions={[
{

View file

@ -72,11 +72,6 @@ export const getTopicMessageSchemaFetched = createSelector(
(status) => status === 'fetched'
);
export const getTopicMessageSent = createSelector(
getTopicMessageSendingStatus,
(status) => status === 'fetched'
);
export const getTopicMessageSending = createSelector(
getTopicMessageSendingStatus,
(status) => status === 'fetching'