pull/4791/head
filip mertens 6 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) readCommitResults.push(readCommitResult)
} }
// Check for the Link header to determine pagination // Check for the Link header to determine pagination
const linkHeader = response.headers.link; const linkHeader = response.headers.link;
@ -1077,7 +1076,6 @@ class DGitProvider extends Plugin {
hasNextPage = linkHeader.includes('rel="next"'); hasNextPage = linkHeader.includes('rel="next"');
} }
pages.push({ pages.push({
page: input.page, page: input.page,
perPage: input.length, 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 (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) 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) { } catch (e) {
console.log(e) console.log(e)
} }
@ -578,12 +597,14 @@ export const loadGitHubUserFromToken = async () => {
type: 'success', type: 'success',
message: `Github user loaded...` message: `Github user loaded...`
}) })
return true
} else { } else {
sendToGitLog({ sendToGitLog({
type: 'error', type: 'error',
message: `Please check your GitHub token in the GitHub settings.` message: `Please check your GitHub token in the GitHub settings.`
}) })
dispatch(setGitHubUser(null)) dispatch(setGitHubUser(null))
return false
} }
} else { } else {
sendToGitLog({ sendToGitLog({
@ -591,9 +612,11 @@ export const loadGitHubUserFromToken = async () => {
message: `Please check your GitHub token in the GitHub settings.` message: `Please check your GitHub token in the GitHub settings.`
}) })
dispatch(setGitHubUser(null)) dispatch(setGitHubUser(null))
return false
} }
} catch (e) { } catch (e) {
console.log(e) console.log(e)
return false
} }
} }

Loading…
Cancel
Save