소스 검색

Fix plate-clear button unclickable after second print (#912)

  The clearPlateMutation.isSuccess state from React Query persisted after
  the first successful plate clear. When the next print finished, the
  stale isSuccess rendered the static confirmation instead of the clickable
  button. Reset mutation state when printer leaves FINISH/FAILED.
maziggy 5 달 전
부모
커밋
502959a0df
4개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      CHANGELOG.md
  2. 9 0
      frontend/src/components/PrinterQueueWidget.tsx
  3. 0 0
      static/assets/index-CNOL7dUq.js
  4. 1 1
      static/index.html

+ 3 - 0
CHANGELOG.md

@@ -4,6 +4,9 @@ All notable changes to Bambuddy will be documented in this file.
 
 ## [0.2.3b3] - Unreleased
 
+### Fixed
+- **"Build Plate Cleared" Button Unclickable After Second Print** ([#912](https://github.com/maziggy/bambuddy/issues/912)) — After completing the first queued print and confirming the plate was cleared, the "Build plate cleared — ready for next print" button became unresponsive after the second print finished. The React Query mutation's `isSuccess` state persisted from the first plate-clear confirmation, causing the component to render the static "Plate Ready" confirmation instead of the clickable button. The mutation state is now reset when the printer leaves the FINISH/FAILED state, so the button works correctly on every print cycle.
+
 ## [0.2.3b2] - 2026-04-08
 
 ### New Features

+ 9 - 0
frontend/src/components/PrinterQueueWidget.tsx

@@ -1,3 +1,4 @@
+import { useEffect } from 'react';
 import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
 import { Clock, Calendar, ChevronRight, Loader2, CircleCheck } from 'lucide-react';
 import { Link } from 'react-router-dom';
@@ -41,6 +42,14 @@ export function PrinterQueueWidget({ printerId, printerModel, printerState, plat
     },
   });
 
+  // Reset mutation state when printer starts a new print cycle so the button
+  // is clickable again when the next print finishes (fixes #912)
+  useEffect(() => {
+    if (printerState !== 'FINISH' && printerState !== 'FAILED') {
+      clearPlateMutation.reset();
+    }
+  }, [printerState]);
+
   // Filter queue to items this printer can actually print (filament type + color check)
   const compatibleQueue = queue ? filterCompatibleQueueItems(queue, loadedFilamentTypes, loadedFilaments) : undefined;
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
static/assets/index-CNOL7dUq.js


+ 1 - 1
static/index.html

@@ -23,7 +23,7 @@
 
     <!-- Splash screens for iOS -->
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
-    <script type="module" crossorigin src="/assets/index-DMDXAsuP.js"></script>
+    <script type="module" crossorigin src="/assets/index-CNOL7dUq.js"></script>
     <link rel="stylesheet" crossorigin href="/assets/index-CA19cW_f.css">
   </head>
   <body>

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.