修复控制台最近调用显示失败的问题:isSuccess 将 LogTypeConsume(2) 和 LogTypeTopup(1) 也识别为成功
This commit is contained in:
parent
b14a09af73
commit
6a99f229e3
|
|
@ -22,7 +22,7 @@ import { ArrowUpRight, Clock, Inbox } from 'lucide-react';
|
||||||
import { renderQuota, renderNumber, timestamp2string } from '../../helpers';
|
import { renderQuota, renderNumber, timestamp2string } from '../../helpers';
|
||||||
|
|
||||||
const isSuccess = (l) =>
|
const isSuccess = (l) =>
|
||||||
l?.type === 0 || l?.status === 0 || l?.type === 'success' || l?.type === undefined;
|
l?.type === 0 || l?.type === 1 || l?.type === 2 || l?.status === 0 || l?.type === 'success' || l?.type === undefined;
|
||||||
|
|
||||||
const RecentActivity = ({ logs = [], className = '' }) => {
|
const RecentActivity = ({ logs = [], className = '' }) => {
|
||||||
const recent = useMemo(() => logs.slice(0, 10), [logs]);
|
const recent = useMemo(() => logs.slice(0, 10), [logs]);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import { API, isAdmin, showError } from '../../helpers';
|
||||||
const PAGE_SIZE = 200;
|
const PAGE_SIZE = 200;
|
||||||
|
|
||||||
const isSuccess = (l) =>
|
const isSuccess = (l) =>
|
||||||
l?.type === 0 || l?.status === 0 || l?.type === 'success';
|
l?.type === 0 || l?.type === 1 || l?.type === 2 || l?.status === 0 || l?.type === 'success';
|
||||||
|
|
||||||
const sum = (arr, key) =>
|
const sum = (arr, key) =>
|
||||||
arr.reduce((s, l) => s + (Number(l[key]) || 0), 0);
|
arr.reduce((s, l) => s + (Number(l[key]) || 0), 0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue