diff --git a/src/components/status-table.tsx b/src/components/status-table.tsx index 8c883ac..f994aea 100644 --- a/src/components/status-table.tsx +++ b/src/components/status-table.tsx @@ -87,14 +87,14 @@ export default function StatusTable(props: StatusTableProps) { }, ) => { try { - const cur = params.current || 1; - const size = params.pageSize || 10; + const cur = params.current ?? 1; + const size = params.pageSize ?? 10; const res = await StatusApi.Query( { pid: props.pid, uid: props.uid, - offset: (cur - 1) * (size || 10), + offset: (cur - 1) * size, limit: size, }, props.token, diff --git a/src/pages/search.tsx b/src/pages/search.tsx index 45a86d6..1a8bcfb 100644 --- a/src/pages/search.tsx +++ b/src/pages/search.tsx @@ -73,13 +73,13 @@ export default function SearchPage() { }, ) => { try { - const cur = params.current || 1; - const size = params.pageSize || 10; + const cur = params.current ?? 1; + const size = params.pageSize ?? 10; const info = await ProblemApi.Search({ - keyword: params.title || "", - tag: params.tags || "", - offset: (cur - 1) * (size || 10), + keyword: params.title ?? "", + tag: params.tags ?? "", + offset: (cur - 1) * size, limit: size, }); const data = info.data.map((i) => {