From eb7381eb4c743fb3201fe72b48e043c12be89ace Mon Sep 17 00:00:00 2001 From: Boris Sekachev <40690378+bsekachev@users.noreply.github.com> Date: Mon, 16 Dec 2019 19:03:32 +0300 Subject: [PATCH] Fixed git plugin (#961) --- cvat-ui/src/utils/git-utils.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cvat-ui/src/utils/git-utils.ts b/cvat-ui/src/utils/git-utils.ts index 6b84a57abdf9..ccc402a8fe17 100644 --- a/cvat-ui/src/utils/git-utils.ts +++ b/cvat-ui/src/utils/git-utils.ts @@ -11,7 +11,7 @@ interface GitPlugin { Task: { prototype: { save: { - leave: (plugin: GitPlugin, task: any) => void; + leave: (plugin: GitPlugin, task: any) => Promise; }; }; }; @@ -73,12 +73,12 @@ async function cloneRepository( this: any, plugin: GitPlugin, createdTask: any, -): Promise { - return new Promise((resolve, reject): void => { +): Promise { + 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..'); @@ -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(