Skip to content

Commit 64eef30

Browse files
committed
feat(chromeExtension): add IS_EXTENSION checks for task jira actions
1 parent 54e1877 commit 64eef30

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app-src/scripts/main/global-services/tasks-s.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/* @ngInject */
1818
class Tasks {
1919

20-
constructor(Uid, $rootScope, Dialogs, IS_ELECTRON, ShortSyntax, TasksUtil, Jira, TakeABreakReminder, SimpleToast, AppStorage, EV, $q) {
20+
constructor(Uid, $rootScope, Dialogs, IS_ELECTRON, IS_EXTENSION, ShortSyntax, TasksUtil, Jira, TakeABreakReminder, SimpleToast, AppStorage, EV, $q) {
2121
this.EV = EV;
2222
this.$rootScope = $rootScope;
2323
this.$q = $q;
@@ -27,6 +27,7 @@
2727
this.ShortSyntax = ShortSyntax;
2828
this.TasksUtil = TasksUtil;
2929
this.IS_ELECTRON = IS_ELECTRON;
30+
this.IS_EXTENSION = IS_EXTENSION;
3031
this.SimpleToast = SimpleToast;
3132
this.Jira = Jira;
3233
this.AppStorage = AppStorage;
@@ -362,7 +363,7 @@
362363
task.isDone = true;
363364
task.doneDate = window.moment();
364365

365-
if (this.IS_ELECTRON) {
366+
if (this.IS_ELECTRON || this.IS_EXTENSION) {
366367
// add worklog before marking the task as done
367368
if (this.TasksUtil.isJiraTask(task)) {
368369
this.Jira.addWorklog(task).then(() => {
@@ -405,7 +406,7 @@
405406
}
406407

407408
// check if in electron context
408-
if (this.IS_ELECTRON) {
409+
if (this.IS_ELECTRON || this.IS_EXTENSION) {
409410
if (!isCallFromTimeTracking) {
410411
const parentTask = task.parentId && this.getById(task.parentId);
411412

0 commit comments

Comments
 (0)