diff options
author | 2022-07-19 17:53:13 +0400 | |
---|---|---|
committer | 2022-07-19 17:53:13 +0400 | |
commit | 6323d91ad9ebd4500a409fd1d5bdff988833e944 (patch) | |
tree | db96cfb9ee5c530014e6817484fbd58ac68fc484 /src/components/OAuth2Button.tsx | |
parent | Clear Authorization On Error (diff) | |
parent | Add 404 Page (diff) |
Merge pull request #485 from python-discord/404
Add 404 Handlers
Diffstat (limited to 'src/components/OAuth2Button.tsx')
-rw-r--r-- | src/components/OAuth2Button.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/OAuth2Button.tsx b/src/components/OAuth2Button.tsx index 885c080..be8d160 100644 --- a/src/components/OAuth2Button.tsx +++ b/src/components/OAuth2Button.tsx @@ -11,7 +11,7 @@ import { selectable } from "../commonStyles"; interface OAuth2ButtonProps { scopes?: OAuthScopes[], - rerender: () => void + rerender?: () => void } const iconStyles = css` @@ -59,7 +59,7 @@ async function login(props: OAuth2ButtonProps, errorDialog: React.RefObject<HTML throw reason.Error; }); - if (checkScopes(props.scopes)) { + if (checkScopes(props.scopes) && props.rerender) { props.rerender(); } } @@ -71,7 +71,7 @@ function OAuth2Button(props: OAuth2ButtonProps): JSX.Element { return <span> <button disabled={disabled} onClick={() => login(props, errorDialog, setDisabled)}> <FontAwesomeIcon icon={faDiscord} css={iconStyles}/> - <span css={textStyles}>Discord Login</span> + <span css={textStyles}>Login To Submit</span> </button> <div css={[errorStyles, selectable]} ref={errorDialog}/> </span>; |