Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x-pack/plugins/code/public/actions/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const indexRepoSuccess = createAction<string>('INDEX REPOS SUCCESS');
export const indexRepoFailed = createAction<Error>('INDEX REPOS FAILED');

export const importRepo = createAction<string>('IMPORT REPO');
export const importRepoSuccess = createAction<string>('IMPORT REPO SUCCESS');
export const importRepoSuccess = createAction<Repository>('IMPORT REPO SUCCESS');
export const importRepoFailed = createAction<Error>('IMPORT REPO FAILED');

export const closeToast = createAction('CLOSE TOAST');
Expand Down
12 changes: 5 additions & 7 deletions x-pack/plugins/code/public/sagas/project_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -43,6 +41,7 @@ import {
pollRepoCloneStatusStop,
pollRepoDeleteStatusStop,
pollRepoIndexStatusStop,
importRepoSuccess,
} from '../actions';
import { RepoState } from '../reducers';
import {
Expand Down Expand Up @@ -170,9 +169,8 @@ export function* watchResetPollingStatus() {
}

const parseCloneStatusPollingRequest = (action: Action<any>) => {
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;
}
Expand Down Expand Up @@ -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
);
}
Expand Down Expand Up @@ -346,7 +344,7 @@ function createRepoStatusPollingRunner(
// Wait for the cancellation task
yield take(pollingStopActionFunctionPattern(repoUri));

// Cancell the task
// Cancel the task
yield cancel(task);
};
}
Expand Down