diff --git a/apps/dokploy/components/dashboard/settings/web-server/update-server.tsx b/apps/dokploy/components/dashboard/settings/web-server/update-server.tsx index 8d1ed2e0..14a66749 100644 --- a/apps/dokploy/components/dashboard/settings/web-server/update-server.tsx +++ b/apps/dokploy/components/dashboard/settings/web-server/update-server.tsx @@ -20,10 +20,28 @@ export const UpdateServer = () => { const [isUpdateAvailable, setIsUpdateAvailable] = useState( null, ); - const { mutateAsync: checkServerUpdates, isLoading } = - api.settings.checkServerUpdates.useMutation(); + const { mutateAsync: checkForUpdate, isLoading } = + api.settings.checkForUpdate.useMutation(); const [isOpen, setIsOpen] = useState(false); + const handleCheckUpdates = async () => { + try { + const updateAvailable = await checkForUpdate(); + setIsUpdateAvailable(updateAvailable); + if (updateAvailable) { + toast.success("Update is available!"); + } else { + toast.info("No updates available"); + } + } catch (error) { + console.error("Error checking for updates:", error); + setIsUpdateAvailable(false); + toast.error( + "An error occurred while checking for updates, please try again.", + ); + } + }; + return ( @@ -76,24 +94,7 @@ export const UpdateServer = () => { ) : (