Skip to content

Commit

Permalink
Fixed git plugin (cvat-ai#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored and Chris Lee-Messer committed Mar 5, 2020
1 parent 9b59de9 commit eb7381e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cvat-ui/src/utils/git-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface GitPlugin {
Task: {
prototype: {
save: {
leave: (plugin: GitPlugin, task: any) => void;
leave: (plugin: GitPlugin, task: any) => Promise<any>;
};
};
};
Expand Down Expand Up @@ -73,12 +73,12 @@ async function cloneRepository(
this: any,
plugin: GitPlugin,
createdTask: any,
): Promise<void> {
return new Promise((resolve, reject): void => {
): Promise<any> {
return new Promise((resolve, reject): any => {
if (typeof (this.id) !== 'undefined' || plugin.data.task !== this) {
// not the first save, we do not need to clone the repository
// or anchor set for another task
resolve();
resolve(createdTask);
} else if (plugin.data.repos) {
if (plugin.callbacks.onStatusChange) {
plugin.callbacks.onStatusChange('The repository is being cloned..');
Expand All @@ -95,7 +95,7 @@ async function cloneRepository(
tid: createdTask.id,
}),
}).then(waitForClone).then((): void => {
resolve();
resolve(createdTask);
}).catch((error: any): void => {
createdTask.delete().finally((): void => {
reject(
Expand Down

0 comments on commit eb7381e

Please sign in to comment.