diff --git a/src/app/settings/server/actions.ts b/src/app/settings/server/actions.ts index 7f8b4b5..7109893 100644 --- a/src/app/settings/server/actions.ts +++ b/src/app/settings/server/actions.ts @@ -106,11 +106,15 @@ export const cleanupOldBuildJobs = async () => return new SuccessActionResult(undefined, 'Successfully cleaned up old build jobs.'); }); +export const revalidateQuickStackVersionCache = async () => + simpleAction(async () => { + revalidateTag(Tags.quickStackVersionInfo()); // separated because updateFunction restarts backend wich results in error + }); + export const updateQuickstack = async () => simpleAction(async () => { await getAdminUserSession(); const useCaranyChannel = await paramService.getBoolean(ParamService.USE_CANARY_CHANNEL, false); - revalidateTag(Tags.quickStackVersionInfo()); await quickStackService.updateQuickStack(useCaranyChannel); return new SuccessActionResult(undefined, 'QuickStack will be updated, refresh the page in a few seconds.'); }); diff --git a/src/app/settings/server/qs-version-info.tsx b/src/app/settings/server/qs-version-info.tsx index b132d64..c06cf77 100644 --- a/src/app/settings/server/qs-version-info.tsx +++ b/src/app/settings/server/qs-version-info.tsx @@ -1,7 +1,7 @@ 'use client'; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; -import { setCanaryChannel, updateQuickstack } from "./actions"; +import { revalidateQuickStackVersionCache, setCanaryChannel, updateQuickstack } from "./actions"; import { Button } from "@/components/ui/button"; import { Toast } from "@/frontend/utils/toast.utils"; import { useConfirmDialog } from "@/frontend/states/zustand.states"; @@ -31,7 +31,8 @@ export default function QuickStackVersionInfo({ description: 'This action will restart the QuickStack service and installs the latest version. It may take a few minutes to complete.', okButton: "Update QuickStack", })) { - Toast.fromAction(() => updateQuickstack()); + await revalidateQuickStackVersionCache(); // separated because updateFunction restarts backend wich results in error + await Toast.fromAction(() => updateQuickstack()); } };