From 035185d9a6d8361132cc41b380afbe3ff48d0ed7 Mon Sep 17 00:00:00 2001 From: anhnhu Date: Wed, 29 May 2024 16:54:36 +0700 Subject: [PATCH] Update network in task on chain --- .../extension-koni-ui/src/Popup/Home/Mission/TaskItem.tsx | 4 ++-- packages/extension-koni-ui/src/connector/booka/types.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/extension-koni-ui/src/Popup/Home/Mission/TaskItem.tsx b/packages/extension-koni-ui/src/Popup/Home/Mission/TaskItem.tsx index cede784395..a102c6e886 100644 --- a/packages/extension-koni-ui/src/Popup/Home/Mission/TaskItem.tsx +++ b/packages/extension-koni-ui/src/Popup/Home/Mission/TaskItem.tsx @@ -77,14 +77,14 @@ const _TaskItem = ({ actionReloadPoint, className, task }: Props): React.ReactEl setTaskLoading(true); let res: SWTransactionResponse | null = null; - const networkKey = 'alephTest'; + const networkKey = task.network || ''; if (onChainType) { const now = new Date(); const date = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`; const data = JSON.stringify({ address, type: onChainType, date }); - res = await actionTaskOnChain(onChainType, 'alephTest', address, data); + res = await actionTaskOnChain(onChainType, networkKey, address, data); if ((res && res.errors.length > 0) || !res) { setTaskLoading(false); diff --git a/packages/extension-koni-ui/src/connector/booka/types.ts b/packages/extension-koni-ui/src/connector/booka/types.ts index f3b3d01cd9..20d27a1ca6 100644 --- a/packages/extension-koni-ui/src/connector/booka/types.ts +++ b/packages/extension-koni-ui/src/connector/booka/types.ts @@ -96,6 +96,7 @@ export interface Task { startTime?: string | null; endTime?: string | null; onChainType?: string | null; + network?: string | null; interval?: number | null; status: TaskHistoryStatus;