Redirect right after a message is sent (#831)
This commit is contained in:
parent
1b2b22f18a
commit
de33c13dc8
4 changed files with 1 additions and 15 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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),
|
||||
});
|
||||
|
|
|
@ -72,7 +72,6 @@ const setupWrapper = (props?: Partial<Props>) => (
|
|||
},
|
||||
}}
|
||||
schemaIsFetched={false}
|
||||
messageIsSent={false}
|
||||
messageIsSending={false}
|
||||
partitions={[
|
||||
{
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Add table
Reference in a new issue