From 5c2842702c4a412d109ca79b850f30f695ef9f31 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Mon, 11 Nov 2019 10:44:05 +0800 Subject: [PATCH] docs: better access token help --- src/components/SideBar.tsx | 31 +++++++++++++++++-------------- src/driver/core/SideBar.ts | 1 - 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/components/SideBar.tsx b/src/components/SideBar.tsx index 781ac8d..ab6baa1 100644 --- a/src/components/SideBar.tsx +++ b/src/components/SideBar.tsx @@ -41,22 +41,25 @@ class Gitako extends React.PureComponent { useListeners(false) } - renderAccessDeniedError() { + renderAccessDeniedError(hasToken: boolean) { return (
Access Denied
-

- Due to{' '} - - limitation of GitHub - {' '} - or{' '} - - auth needs - - , Gitako needs access token to continue. Please follow the instructions in the settings - panel below. -

+ {hasToken ? ( +

Current access token is not granted with permissions to access this project.

+ ) : ( +

+ Gitako needs access token to read this project due to{' '} + + GitHub rate limiting + {' '} + and{' '} + + auth needs + + . Please setup access token in the settings panel below. +

+ )}
) } @@ -75,7 +78,7 @@ class Gitako extends React.PureComponent {
{metaData && } {errorDueToAuth - ? this.renderAccessDeniedError() + ? this.renderAccessDeniedError(Boolean(accessToken)) : metaData && ( = 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!')