Skip to content

Commit

Permalink
Sort task
Browse files Browse the repository at this point in the history
  • Loading branch information
anhnhu committed May 31, 2024
1 parent c42e1dd commit b3b6d5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/extension-koni-ui/src/Popup/Home/Mission/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { GameAccountBlock } from '@subwallet/extension-koni-ui/components';
import { BookaSdk } from '@subwallet/extension-koni-ui/connector/booka/sdk';
import { EnergyConfig, Task, TaskCategory, TaskCategoryInfo, TaskHistoryStatus } from '@subwallet/extension-koni-ui/connector/booka/types';
import { EnergyConfig, Task, TaskCategory, TaskCategoryInfo } from '@subwallet/extension-koni-ui/connector/booka/types';
import { HomeContext } from '@subwallet/extension-koni-ui/contexts/screen/HomeContext';
import { useSetCurrentPage } from '@subwallet/extension-koni-ui/hooks';
import { TaskList } from '@subwallet/extension-koni-ui/Popup/Home/Mission/TaskList';
Expand Down Expand Up @@ -66,11 +66,11 @@ function getTaskCategoryInfoMap (tasks: Task[]): Record<number, TaskCategoryInfo
return -1;
}

if (a.status === TaskHistoryStatus.COMPLETED && b.status !== TaskHistoryStatus.COMPLETED) {
if (a.completedAt && !b.completedAt) {
return 1;
}

if (a.status !== TaskHistoryStatus.COMPLETED && b.status === TaskHistoryStatus.COMPLETED) {
if (!a.completedAt && b.completedAt) {
return -1;
}

Expand Down

0 comments on commit b3b6d5a

Please sign in to comment.