pull/4791/head
filip mertens 6 months ago
parent b5dcbc6ba3
commit deea4edbd2
  1. 2
      apps/remix-ide/src/app/plugins/git.tsx
  2. 6
      libs/remix-ui/git/src/components/panels/githubcredentials.tsx
  3. 1
      libs/remix-ui/git/src/lib/gitactions.ts

@ -19,8 +19,6 @@ const profile = {
export class GitPlugin extends ViewPlugin { export class GitPlugin extends ViewPlugin {
constructor() { constructor() {
super(profile) super(profile)

@ -14,11 +14,13 @@ export const GitHubCredentials = () => {
const [githubToken, setGithubToken] = React.useState('') const [githubToken, setGithubToken] = React.useState('')
const [githubUsername, setGithubUsername] = React.useState('') const [githubUsername, setGithubUsername] = React.useState('')
const [githubEmail, setGithubEmail] = React.useState('') const [githubEmail, setGithubEmail] = React.useState('')
const [scopeWarning, setScopeWarning] = React.useState(false)
const intl = useIntl() const intl = useIntl()
useEffect(() => { useEffect(() => {
refresh() refresh()
}, [loader.plugin, context.gitHubAccessToken, context.userEmails, context.gitHubUser]) setScopeWarning(!(context.gitHubScopes && context.gitHubScopes.length > 0))
}, [loader.plugin, context.gitHubAccessToken, context.userEmails, context.gitHubUser, context.gitHubScopes])
function handleChangeTokenState(e: string): void { function handleChangeTokenState(e: string): void {
setGithubToken(e) setGithubToken(e)
@ -76,6 +78,8 @@ export const GitHubCredentials = () => {
<button className="btn btn-danger far fa-trash-alt" onClick={removeToken}> <button className="btn btn-danger far fa-trash-alt" onClick={removeToken}>
</button> </button>
</div> </div>
{scopeWarning?
<div className="text-warning">Your GitHub token may not have the correct permissions. Please use the login with GitHub feature.</div>:null}
<hr /> <hr />
</> </>
); );

@ -544,6 +544,7 @@ export const saveGitHubCredentials = async (credentials: { username: string, ema
verified: null, verified: null,
visibility: null visibility: null
}])) }]))
dispatch(setScopes([]))
} }
} catch (e) { } catch (e) {

Loading…
Cancel
Save