fix spool weight < 0 check

This commit is contained in:
TomW1605
2024-10-27 15:20:53 +08:00
parent efae0d8466
commit d60b93349a
2 changed files with 2 additions and 2 deletions

View File

@@ -189,7 +189,7 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
const archiveSpoolPopup = async (spool: ISpoolCollapsed) => { const archiveSpoolPopup = async (spool: ISpoolCollapsed) => {
// If the spool has no remaining weight, archive it immediately since it's likely not a mistake // 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); await archiveSpool(spool, true);
} else { } else {
confirm({ confirm({

View File

@@ -57,7 +57,7 @@ export const SpoolShow: React.FC<IResourceComponentsProps> = () => {
return return
} }
// If the spool has no remaining weight, archive it immediately since it's likely not a mistake // 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); await archiveSpool(spool, true);
} else { } else {
confirm({ confirm({