Skip to content

Commit dec0af6

Browse files
authored
Merge pull request #2116 from JoinColony/fix/task-finalize-persistent
Finalize both Tasks and Persistent Tasks
2 parents 172d199 + 06ec6c8 commit dec0af6

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

src/modules/dashboard/components/ProgramReview/ProgramReviewItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ const ProgramReviewItem = ({
127127
payouts,
128128
skillId,
129129
workerAddress: worker.profile.walletAddress,
130+
persistent: true,
130131
});
131132
}
132133
await acceptLevelTaskSubmission();

src/modules/dashboard/sagas/task.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ function* taskFinalize({
8181
domainId,
8282
skillId,
8383
payouts,
84+
persistent = false,
8485
},
8586
meta,
8687
}: Action<ActionTypes.TASK_FINALIZE>) {
@@ -116,21 +117,23 @@ function* taskFinalize({
116117
payload: { hash: txHash },
117118
} = yield takeFrom(txChannel, ActionTypes.TRANSACTION_HASH_RECEIVED);
118119

119-
/*
120-
* @NOTE Put the task in a pending state
121-
*/
122-
yield apolloClient.mutate<
123-
SetTaskPendingMutation,
124-
SetTaskPendingMutationVariables
125-
>({
126-
mutation: SetTaskPendingDocument,
127-
variables: {
128-
input: {
129-
id: draftId,
130-
txHash,
120+
if (!persistent) {
121+
/*
122+
* @NOTE Put the task in a pending state
123+
*/
124+
yield apolloClient.mutate<
125+
SetTaskPendingMutation,
126+
SetTaskPendingMutationVariables
127+
>({
128+
mutation: SetTaskPendingDocument,
129+
variables: {
130+
input: {
131+
id: draftId,
132+
txHash,
133+
},
131134
},
132-
},
133-
});
135+
});
136+
}
134137

135138
yield takeFrom(txChannel, ActionTypes.TRANSACTION_RECEIPT_RECEIVED);
136139

src/redux/types/actions/task.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export type TaskActionTypes =
6767
domainId: number;
6868
skillId: number;
6969
payouts: Payouts;
70+
persistent: boolean;
7071
}
7172
>
7273
| TaskErrorActionType<ActionTypes.TASK_FINALIZE_ERROR>

0 commit comments

Comments
 (0)