mirror of
https://github.com/logto-io/logto.git
synced 2025-01-20 21:32:31 -05:00
fix(console): jump to enabled connector (#1225)
This commit is contained in:
parent
a8467fd093
commit
833436ad15
1 changed files with 5 additions and 4 deletions
|
@ -19,16 +19,17 @@ type Props = {
|
|||
|
||||
const ConnectorRow = ({ type, connectors, onClickSetup }: Props) => {
|
||||
const { t } = useTranslation(undefined);
|
||||
const inUse = useConnectorInUse(type, connectors[0]?.target);
|
||||
const firstEnabledConnector = connectors.find(({ enabled }) => enabled);
|
||||
const inUse = useConnectorInUse(type, firstEnabledConnector?.target);
|
||||
const navigate = useNavigate();
|
||||
const showSetupButton = type !== ConnectorType.Social && !connectors[0];
|
||||
const showSetupButton = type !== ConnectorType.Social && !firstEnabledConnector;
|
||||
|
||||
const handleClickRow = () => {
|
||||
if (showSetupButton || !connectors[0]) {
|
||||
if (showSetupButton || !firstEnabledConnector) {
|
||||
return;
|
||||
}
|
||||
|
||||
navigate(`/connectors/${connectors[0].id}`);
|
||||
navigate(`/connectors/${firstEnabledConnector.id}`);
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Reference in a new issue