mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
docs: better access token help
This commit is contained in:
parent
0458fc36f0
commit
5c2842702c
2 changed files with 17 additions and 15 deletions
|
|
@ -41,22 +41,25 @@ class Gitako extends React.PureComponent<Props & ConnectorState> {
|
|||
useListeners(false)
|
||||
}
|
||||
|
||||
renderAccessDeniedError() {
|
||||
renderAccessDeniedError(hasToken: boolean) {
|
||||
return (
|
||||
<div className={'description'}>
|
||||
<h5>Access Denied</h5>
|
||||
<p>
|
||||
Due to{' '}
|
||||
<a target="_blank" href="https://developer.github.com/v3/#rate-limiting">
|
||||
limitation of GitHub
|
||||
</a>{' '}
|
||||
or{' '}
|
||||
<a target="_blank" href="https://developer.github.com/v3/#authentication">
|
||||
auth needs
|
||||
</a>
|
||||
, Gitako needs access token to continue. Please follow the instructions in the settings
|
||||
panel below.
|
||||
</p>
|
||||
{hasToken ? (
|
||||
<p>Current access token is not granted with permissions to access this project.</p>
|
||||
) : (
|
||||
<p>
|
||||
Gitako needs access token to read this project due to{' '}
|
||||
<a target="_blank" href="https://developer.github.com/v3/#rate-limiting">
|
||||
GitHub rate limiting
|
||||
</a>{' '}
|
||||
and{' '}
|
||||
<a target="_blank" href="https://developer.github.com/v3/#authentication">
|
||||
auth needs
|
||||
</a>
|
||||
. Please setup access token in the settings panel below.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -75,7 +78,7 @@ class Gitako extends React.PureComponent<Props & ConnectorState> {
|
|||
<div className={'gitako-side-bar-content'}>
|
||||
{metaData && <MetaBar metaData={metaData} />}
|
||||
{errorDueToAuth
|
||||
? this.renderAccessDeniedError()
|
||||
? this.renderAccessDeniedError(Boolean(accessToken))
|
||||
: metaData && (
|
||||
<FileExplorer
|
||||
compressSingletonFolder={compressSingletonFolder}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,6 @@ const handleError: BoundMethodCreator<[Error]> = dispatch => async err => {
|
|||
) {
|
||||
dispatch.set({ errorDueToAuth: true })
|
||||
dispatch.call(setShowSettings, true)
|
||||
dispatch.call(setShouldShow, true)
|
||||
} else {
|
||||
dispatch.call(useListeners, false)
|
||||
dispatch.call(setError, 'Gitako ate a bug, but it should recovery soon!')
|
||||
|
|
|
|||
Loading…
Reference in a new issue