git4refactor
filip mertens 7 months ago
parent e1fc893076
commit aa7d58bad1
  1. 2
      libs/remix-ui/git/src/components/github/repositoryselect.tsx
  2. 8
      libs/remix-ui/git/src/lib/gitactions.ts
  3. 11
      libs/remix-ui/git/src/state/gitreducer.tsx

@ -64,7 +64,7 @@ const RepositorySelect = (props: RepositorySelectProps) => {
};
return (
<><TokenWarning /><Button onClick={fetchRepositories} className="w-100 mt-1">
<><Button onClick={fetchRepositories} className="w-100 mt-1">
<i className="fab fa-github mr-1"></i>Fetch Repositories from GitHub
</Button>
{

@ -488,7 +488,7 @@ export const repositories = async () => {
} else {
plugin.call('notification', 'alert', {
title: 'Error getting repositories',
message: `Please check your GitHub token in the GitHub settings. It needs to have access to the repositories.`
message: `Please check your GitHub token in the GitHub settings... cannot connect to GitHub`
})
dispatch(setRepos([]))
}
@ -558,12 +558,8 @@ export const remoteCommits = async (url: string, branch: string, length: number)
} else {
sendToGitLog({
type: 'error',
message: `Please check your GitHub token in the GitHub settings. It needs to have access to the commits.`
message: `Please check your GitHub token in the GitHub settings.`
})
//plugin.call('notification', 'alert', {
// title: 'Error getting commits',
// message: `Please check your GitHub token in the GitHub settings. It needs to have access to the commits.`
//})
}
} catch (e) {
console.log(e)

@ -182,11 +182,20 @@ export const gitReducer = (state: gitState = defaultGitState, action: Action): g
}
case 'SET_LOG':
const previousLog = [...state.log]
// check if the new message is the same as the last
if (previousLog.length > 0 && previousLog[previousLog.length - 1].message === action.payload.message) {
return {
...state,
log: previousLog
}
}
return {
...state,
log: [...state.log, action.payload]
log: [...previousLog, action.payload]
}
case 'CLEAR_LOG':
return {
...state,

Loading…
Cancel
Save