mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Don't hide form elements in GitHub component if we're not checking auth (#675)
* Don't check authentication if we're not requesting you to login * changelog
This commit is contained in:
parent
b5b86d45da
commit
05b23127d8
1
changelog.d/675.bugfix
Normal file
1
changelog.d/675.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Don't hide Create Connection button in Migration component.
|
@ -103,9 +103,11 @@ const ConnectionConfiguration: FunctionComponent<ConnectionConfigurationProps<ne
|
||||
|
||||
const clearInstance = useCallback(() => setConnectionState(null), [setConnectionState]);
|
||||
|
||||
const consideredAuthenticated = (authedResponse?.authenticated || !showAuthPrompt);
|
||||
|
||||
return <form onSubmit={handleSave}>
|
||||
{authedResponse && <ServiceAuth onAuthSucceeded={checkAuth} authState={authedResponse} service="github" loginLabel={loginLabel} api={api} />}
|
||||
{!existingConnection && authedResponse?.authenticated && <ConnectionSearch
|
||||
{!existingConnection && consideredAuthenticated && <ConnectionSearch
|
||||
serviceName="GitHub"
|
||||
addNewInstanceUrl={newInstallationUrl}
|
||||
getInstances={getInstances}
|
||||
@ -152,7 +154,7 @@ const ConnectionConfiguration: FunctionComponent<ConnectionConfigurationProps<ne
|
||||
</ul>
|
||||
</InputField>
|
||||
<ButtonSet>
|
||||
{ canEdit && authedResponse?.authenticated && <Button type="submit" disabled={!existingConnection && !connectionState}>{ existingConnection?.id ? "Save" : "Add repository" }</Button>}
|
||||
{ canEdit && consideredAuthenticated && <Button type="submit" disabled={!existingConnection && !connectionState}>{ existingConnection?.id ? "Save" : "Add repository" }</Button>}
|
||||
{ canEdit && existingConnection?.id && <Button intent="remove" onClick={onRemove}>Remove repository</Button>}
|
||||
</ButtonSet>
|
||||
</form>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user