pull/4791/head
filip mertens 5 months ago
parent 8695d259bf
commit 62782ebe71
  1. 2
      apps/remix-ide/src/app/files/dgitProvider.ts
  2. 23
      libs/remix-ui/git/src/lib/gitactions.ts

@ -1067,7 +1067,6 @@ class DGitProvider extends Plugin {
readCommitResults.push(readCommitResult)
}
// Check for the Link header to determine pagination
const linkHeader = response.headers.link;
@ -1077,7 +1076,6 @@ class DGitProvider extends Plugin {
hasNextPage = linkHeader.includes('rel="next"');
}
pages.push({
page: input.page,
perPage: input.length,

@ -523,6 +523,25 @@ export const saveGitHubCredentials = async (credentials: { username: string, ema
if (storedEmail !== credentials.email) await plugin.call('config', 'setAppParameter', 'settings/github-email', credentials.email)
if (storedToken !== credentials.token) await plugin.call('config', 'setAppParameter', 'settings/gist-access-token', credentials.token)
const userFetched = await loadGitHubUserFromToken()
if (!userFetched) {
if (credentials.username && credentials.email) {
await plugin.call('notification', 'alert', {
title: 'Error',
message: `Could not retreive the user from GitHub. You can continue to use the app, but you will not be able to push or pull.`
})
}
dispatch(setGitHubUser({
login: credentials.username,
}))
dispatch(setUserEmails([{
email: credentials.email,
primary: true,
verified: null,
visibility: null
}]))
}
} catch (e) {
console.log(e)
}
@ -578,12 +597,14 @@ export const loadGitHubUserFromToken = async () => {
type: 'success',
message: `Github user loaded...`
})
return true
} else {
sendToGitLog({
type: 'error',
message: `Please check your GitHub token in the GitHub settings.`
})
dispatch(setGitHubUser(null))
return false
}
} else {
sendToGitLog({
@ -591,9 +612,11 @@ export const loadGitHubUserFromToken = async () => {
message: `Please check your GitHub token in the GitHub settings.`
})
dispatch(setGitHubUser(null))
return false
}
} catch (e) {
console.log(e)
return false
}
}

Loading…
Cancel
Save