Improve SpoolBuddy update UX: auto-check and remove beta toggle

The SpoolBuddy layout now auto-checks for daemon updates every 5
  minutes and shows "Update available: v{version}" in the status bar.
  Removed the beta toggle since SpoolBuddy follows Bambuddy's release
  channel. The daemon version is now read from backend APP_VERSION
  instead of a stale hardcoded string.
This commit is contained in:
maziggy
2026-03-22 13:15:44 +01:00
parent 18700cf5da
commit 311a14e7ec
5 changed files with 61 additions and 94 deletions
@@ -58,14 +58,25 @@ export function SpoolBuddyLayout() {
};
}, []);
// Update alert based on device state
// Auto-check for SpoolBuddy daemon updates
const { data: updateCheck } = useQuery({
queryKey: ['spoolbuddy-update-check', device?.device_id],
queryFn: () => device ? spoolbuddyApi.checkDaemonUpdate(device.device_id, true) : Promise.resolve(null),
enabled: !!device,
refetchInterval: 5 * 60 * 1000, // re-check every 5 minutes
staleTime: 4 * 60 * 1000,
});
// Update alert based on device state and available updates
useEffect(() => {
if (!sbState.deviceOnline) {
setAlert({ type: 'warning', message: 'SpoolBuddy device disconnected' });
} else if (updateCheck?.update_available && updateCheck.latest_version) {
setAlert({ type: 'info', message: `Update available: v${updateCheck.latest_version}` });
} else {
setAlert(null);
}
}, [sbState.deviceOnline]);
}, [sbState.deviceOnline, updateCheck]);
// Track user activity for screen blank
const resetActivity = useCallback(() => {