From f56d2122a77d0ccebe687e20261f062ec99d2dda Mon Sep 17 00:00:00 2001 From: anhnhu Date: Tue, 11 Jun 2024 15:35:13 +0700 Subject: [PATCH] Update logic share leaderboard in task --- .../src/Popup/Home/Mission/TaskItem.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 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 d5cb6ec301..b1d6ca6527 100644 --- a/packages/extension-koni-ui/src/Popup/Home/Mission/TaskItem.tsx +++ b/packages/extension-koni-ui/src/Popup/Home/Mission/TaskItem.tsx @@ -121,6 +121,7 @@ const _TaskItem = ({ actionReloadPoint, className, task }: Props): React.ReactEl console.error('shareLeaderboard', e); } } + apiSDK.finishTask(taskId, extrinsicHash, networkKey) .finally(() => { setTaskLoading(false); @@ -137,14 +138,14 @@ const _TaskItem = ({ actionReloadPoint, className, task }: Props): React.ReactEl setTimeout(async () => { let urlRedirect = task.url; - if (urlRedirect) { - if (shareLeaderboard && shareLeaderboard.content) { - const startEnv = shareLeaderboard.start_time; - const endEnv = shareLeaderboard.end_time; + if (shareLeaderboard && shareLeaderboard.content) { + const startEnv = shareLeaderboard.start_time; + const endEnv = shareLeaderboard.end_time; - urlRedirect = await apiSDK.getShareTwitterURL(startEnv, endEnv, shareLeaderboard.content, task.gameId ?? 0, shareLeaderboard.url); - } + urlRedirect = await apiSDK.getShareTwitterURL(startEnv, endEnv, shareLeaderboard.content, task.gameId ?? 0, shareLeaderboard.url); + } + if (urlRedirect) { telegramConnector.openLink(urlRedirect); } }, 100);