From d60b93349ae3360e159de58f041cf8b4d0a69382 Mon Sep 17 00:00:00 2001 From: TomW1605 Date: Sun, 27 Oct 2024 15:20:53 +0800 Subject: [PATCH] fix spool weight < 0 check --- client/src/pages/spools/list.tsx | 2 +- client/src/pages/spools/show.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/pages/spools/list.tsx b/client/src/pages/spools/list.tsx index c153309..d19f73f 100644 --- a/client/src/pages/spools/list.tsx +++ b/client/src/pages/spools/list.tsx @@ -189,7 +189,7 @@ export const SpoolList: React.FC = () => { const archiveSpoolPopup = async (spool: ISpoolCollapsed) => { // If the spool has no remaining weight, archive it immediately since it's likely not a mistake - if (spool.remaining_weight && spool.remaining_weight == 0) { + if (spool.remaining_weight != undefined && spool.remaining_weight <= 0) { await archiveSpool(spool, true); } else { confirm({ diff --git a/client/src/pages/spools/show.tsx b/client/src/pages/spools/show.tsx index abf0f19..acfb27d 100644 --- a/client/src/pages/spools/show.tsx +++ b/client/src/pages/spools/show.tsx @@ -57,7 +57,7 @@ export const SpoolShow: React.FC = () => { return } // If the spool has no remaining weight, archive it immediately since it's likely not a mistake - if (spool.remaining_weight && spool.remaining_weight == 0) { + if (spool.remaining_weight != undefined && spool.remaining_weight <= 0) { await archiveSpool(spool, true); } else { confirm({