|
|
@@ -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;
|
|
|
|