fix favicon update flow and site media picker
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-07 19:46:51 +01:00
parent 1d5ac565ad
commit 1a8d53bda1
11 changed files with 250 additions and 104 deletions
+8 -1
View File
@@ -12,6 +12,7 @@ type FormSaveButtonProps = {
formSelector?: string;
formSelectors?: string[];
label?: string;
reloadDocumentOnSuccess?: boolean;
};
function serializeForm(form: HTMLFormElement) {
@@ -29,6 +30,7 @@ export function FormSaveButton({
formSelector,
formSelectors,
label = "Speichern",
reloadDocumentOnSuccess = false,
}: FormSaveButtonProps) {
const pathname = usePathname();
const router = useRouter();
@@ -220,6 +222,11 @@ export function FormSaveButton({
}
pendingSubmissionRef.current = null;
if (reloadDocumentOnSuccess) {
window.location.reload();
return;
}
router.refresh();
if (!searchParams.has("__saved")) {
@@ -233,7 +240,7 @@ export function FormSaveButton({
router.replace(nextQuery ? `${pathname}?${nextQuery}` : pathname, {
scroll: false,
});
}, [currentUrl, pathname, router, searchParams]);
}, [currentUrl, pathname, reloadDocumentOnSuccess, router, searchParams]);
return (
<Button type="submit" form={activeFormId ?? undefined} disabled={!activeFormId || !isDirty || isSubmitting}>