Skip to content
This repository was archived by the owner on Dec 7, 2022. It is now read-only.

Commit ad40a71

Browse files
Report times sequentially rather than concurrently
YouTrack seems to have a problem with the latter
1 parent a3644b8 commit ad40a71

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/Content.vue.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@ export default class Content extends Vue {
5656

5757
public async onReportNowClicked(event: MouseEvent) {
5858
const youTrack = this.createYouTrack();
59-
let newSpentTimes: IIssueWorkItem[];
59+
const newSpentTimes = new Array<IIssueWorkItem>();
6060

6161
try {
6262
this.isLoading = true;
6363
const workItemTypes = new Map<string, string>(
6464
(await youTrack.getWorkItemTypes()).map((t) => [ t.name, t.id ] as [ string, string ]));
65-
newSpentTimes = await Promise.all(
66-
this.checkedModel.times.map((spentTime) => Content.createWorkItem(youTrack, workItemTypes, spentTime)));
65+
66+
for (const time of this.checkedModel.times) {
67+
newSpentTimes.push(await Content.createWorkItem(youTrack, workItemTypes, time));
68+
}
6769
} catch (e) {
6870
this.statusSnackbar.showError(Content.getErrorMessage(e));
6971

0 commit comments

Comments
 (0)