Skip to content

Commit

Permalink
Merge branch 'refs/heads/koni/dev/issue-task-share-leaderboard' into …
Browse files Browse the repository at this point in the history
…telegram-dev
  • Loading branch information
anhnhu committed Jun 11, 2024
2 parents f267ee8 + f56d212 commit a90c80b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/extension-koni-ui/src/Popup/Home/Mission/TaskItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const _TaskItem = ({ actionReloadPoint, className, task }: Props): React.ReactEl
console.error('shareLeaderboard', e);
}
}

apiSDK.finishTask(taskId, extrinsicHash, networkKey)
.finally(() => {
setTaskLoading(false);
Expand All @@ -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);
Expand Down

0 comments on commit a90c80b

Please sign in to comment.