diff --git a/x-pack/plugins/code/public/actions/repository.ts b/x-pack/plugins/code/public/actions/repository.ts index 316cdd7bfdb25..05cd51accc6f5 100644 --- a/x-pack/plugins/code/public/actions/repository.ts +++ b/x-pack/plugins/code/public/actions/repository.ts @@ -28,7 +28,7 @@ export const indexRepoSuccess = createAction('INDEX REPOS SUCCESS'); export const indexRepoFailed = createAction('INDEX REPOS FAILED'); export const importRepo = createAction('IMPORT REPO'); -export const importRepoSuccess = createAction('IMPORT REPO SUCCESS'); +export const importRepoSuccess = createAction('IMPORT REPO SUCCESS'); export const importRepoFailed = createAction('IMPORT REPO FAILED'); export const closeToast = createAction('CLOSE TOAST'); diff --git a/x-pack/plugins/code/public/sagas/project_status.ts b/x-pack/plugins/code/public/sagas/project_status.ts index c01238dc87638..47cec8c257e2e 100644 --- a/x-pack/plugins/code/public/sagas/project_status.ts +++ b/x-pack/plugins/code/public/sagas/project_status.ts @@ -21,14 +21,12 @@ import { takeLatest, } from 'redux-saga/effects'; -import { RepositoryUtils } from '../../common/repository_utils'; import { Repository, RepositoryUri, WorkerReservedProgress } from '../../model'; import * as ROUTES from '../components/routes'; import { allStatusSelector, repoUriSelector, routeSelector } from '../selectors'; import { deleteRepo, fetchReposSuccess, - importRepo, indexRepo, loadRepoSuccess, loadStatusFailed, @@ -43,6 +41,7 @@ import { pollRepoCloneStatusStop, pollRepoDeleteStatusStop, pollRepoIndexStatusStop, + importRepoSuccess, } from '../actions'; import { RepoState } from '../reducers'; import { @@ -170,9 +169,8 @@ export function* watchResetPollingStatus() { } const parseCloneStatusPollingRequest = (action: Action) => { - if (action.type === String(importRepo)) { - const repoUrl: string = action.payload; - return RepositoryUtils.buildRepository(repoUrl).uri; + if (action.type === String(importRepoSuccess)) { + return action.payload.uri; } else if (action.type === String(pollRepoCloneStatusStart)) { return action.payload; } @@ -213,7 +211,7 @@ export function* watchRepoCloneStatusPolling() { // * user click import repository // * repository status has been loaded and it's in cloning yield takeEvery( - [String(importRepo), String(pollRepoCloneStatusStart)], + [String(importRepoSuccess), String(pollRepoCloneStatusStart)], pollRepoCloneStatusRunner ); } @@ -346,7 +344,7 @@ function createRepoStatusPollingRunner( // Wait for the cancellation task yield take(pollingStopActionFunctionPattern(repoUri)); - // Cancell the task + // Cancel the task yield cancel(task); }; }