Added missing toast messages to Spoolman settings

This commit is contained in:
maziggy
2026-02-06 14:12:12 +01:00
parent dccf85de74
commit 5803c8ceb1
3 changed files with 49 additions and 52 deletions
+3 -6
View File
@@ -6,16 +6,17 @@ import { api } from '../api/client';
import type { SpoolmanSyncResult, Printer } from '../api/client';
import { Card, CardContent, CardHeader } from './Card';
import { Button } from './Button';
import { useToast } from '../contexts/ToastContext';
export function SpoolmanSettings() {
const { t } = useTranslation();
const queryClient = useQueryClient();
const { showToast } = useToast();
const [localEnabled, setLocalEnabled] = useState(false);
const [localUrl, setLocalUrl] = useState('');
const [localSyncMode, setLocalSyncMode] = useState('auto');
const [localDisableWeightSync, setLocalDisableWeightSync] = useState(false);
const [localReportPartialUsage, setLocalReportPartialUsage] = useState(true);
const [showSaved, setShowSaved] = useState(false);
const [selectedPrinterId, setSelectedPrinterId] = useState<number | 'all'>('all');
const [isInitialized, setIsInitialized] = useState(false);
const [showAllSkipped, setShowAllSkipped] = useState(false);
@@ -85,8 +86,7 @@ export function SpoolmanSettings() {
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['spoolman-settings'] });
queryClient.invalidateQueries({ queryKey: ['spoolman-status'] });
setShowSaved(true);
setTimeout(() => setShowSaved(false), 2000);
showToast(t('settings.toast.settingsSaved'));
},
});
@@ -169,9 +169,6 @@ export function SpoolmanSettings() {
{saveMutation.isPending && (
<Loader2 className="w-4 h-4 text-bambu-green animate-spin" />
)}
{showSaved && (
<Check className="w-4 h-4 text-bambu-green" />
)}
</div>
</CardHeader>
<CardContent className="space-y-4">
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -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-AXQRHtw2.js"></script>
<script type="module" crossorigin src="/assets/index-BZQD54OI.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-togsBDt6.css">
</head>
<body>