diff --git a/apps/remix-ide/src/app/files/dgitProvider.ts b/apps/remix-ide/src/app/files/dgitProvider.ts index 1fa78ca304..a927de03a5 100644 --- a/apps/remix-ide/src/app/files/dgitProvider.ts +++ b/apps/remix-ide/src/app/files/dgitProvider.ts @@ -1016,14 +1016,12 @@ class DGitProvider extends Plugin { const user = await octokit.request('GET /user') const emails = await octokit.request('GET /user/emails') - const scopes = user.headers['x-oauth-scopes']; - - console.log('scopes', scopes) + const scopes = user.headers['x-oauth-scopes'] || '' return { user: user.data, emails: emails.data, - scopes: scopes.split(',') + scopes: scopes && scopes.split(',') } } catch (e) { return null diff --git a/libs/remix-ui/git/src/components/github/devicecode.tsx b/libs/remix-ui/git/src/components/github/devicecode.tsx index 55e01bf526..9e53099699 100644 --- a/libs/remix-ui/git/src/components/github/devicecode.tsx +++ b/libs/remix-ui/git/src/components/github/devicecode.tsx @@ -73,13 +73,6 @@ export const GetDeviceCode = () => { await actions.loadGitHubUserFromToken() } - const checkConnection = async () => { - //await actions.loadGitHubUserFromToken() - } - - useEffect(() => { - - }, []) return ( <> diff --git a/libs/remix-ui/git/src/components/panels/commands.tsx b/libs/remix-ui/git/src/components/panels/commands.tsx index bb1abc9991..f1b9cfc952 100644 --- a/libs/remix-ui/git/src/components/panels/commands.tsx +++ b/libs/remix-ui/git/src/components/panels/commands.tsx @@ -10,7 +10,5 @@ export const Commands = () => {
-
- ) } \ No newline at end of file diff --git a/libs/remix-ui/git/src/components/panels/log.tsx b/libs/remix-ui/git/src/components/panels/log.tsx index 4c1b627b5d..6f1aeba5e6 100644 --- a/libs/remix-ui/git/src/components/panels/log.tsx +++ b/libs/remix-ui/git/src/components/panels/log.tsx @@ -24,7 +24,7 @@ const LogViewer = () => { return (
- {context.log && context.log.map((log, index) => ( + {context.log && context.log.reverse().map((log, index) => (
[{log.type.toUpperCase()}] {log.message}
diff --git a/libs/remix-ui/git/src/lib/gitactions.ts b/libs/remix-ui/git/src/lib/gitactions.ts index 9421161e47..0dd9891e3d 100644 --- a/libs/remix-ui/git/src/lib/gitactions.ts +++ b/libs/remix-ui/git/src/lib/gitactions.ts @@ -559,14 +559,22 @@ export const loadGitHubUserFromToken = async () => { dispatch(setGitHubUser(data.user)) dispatch(setScopes(data.scopes)) dispatch(setUserEmails(data.emails)) - + sendToGitLog({ + type: 'success', + message: `Github user loaded...` + }) + }else{ + sendToGitLog({ + type: 'error', + message: `Please check your GitHub token in the GitHub settings.` + }) + dispatch(setGitHubUser(null)) } } else { - const credentials = await getGitHubCredentialsFromLocalStorage() - if (credentials) { - //dispatch(setGitHubUser({ login: credentials.username })) - //dispatch(setUserEmails([{ email: credentials.email, primary: true, visibility: 'public', verified: true }])) - } + sendToGitLog({ + type: 'error', + message: `Please check your GitHub token in the GitHub settings.` + }) dispatch(setGitHubUser(null)) } } catch (e) {