fix: stabilize release e2e flows
This commit is contained in:
1 parent
81fdc5856b
commit
c4f6d98300
5 files changed
+14
-2246
No files matched your search
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { startTransition, useCallback, useEffect, useRef, useState } from "react";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { Box, Center, Loader, Menu, ScrollArea } from "@mantine/core";
|
||||
@@ -161,7 +161,7 @@ const EditModeMenu = ({ demoReadOnly }: { demoReadOnly: boolean }) => {
|
||||
setIsEnteringEditMode(true);
|
||||
try {
|
||||
await prepareEditorAsync();
|
||||
startTransition(open);
|
||||
open();
|
||||
} catch {
|
||||
showErrorNotification({
|
||||
title: t("notification.loadError.title"),
|
||||
|
||||
+4
-3
@@ -2,7 +2,6 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import type { Dispatch, SetStateAction } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import type { UseFormReturnType } from "@mantine/form";
|
||||
|
||||
import { clientApi } from "@homarr/api/client";
|
||||
@@ -37,7 +36,6 @@ interface FormActionsInput {
|
||||
}
|
||||
|
||||
export function useCustomWidgetFormActions(input: FormActionsInput) {
|
||||
const router = useRouter();
|
||||
const t = useScopedI18n("customWidget");
|
||||
const w = useScopedI18n("customWidget.workbench");
|
||||
const utils = clientApi.useUtils();
|
||||
@@ -70,7 +68,10 @@ export function useCustomWidgetFormActions(input: FormActionsInput) {
|
||||
title: t("action.create"),
|
||||
message: t("notification.created", { name: values.name }),
|
||||
});
|
||||
router.push(`/manage/custom-widgets/edit/${result.id}`);
|
||||
input.form.setInitialValues(values);
|
||||
input.form.resetDirty();
|
||||
await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));
|
||||
window.location.assign(result.managementPath);
|
||||
} else if (input.definitionId) {
|
||||
await updateMutation.mutateAsync({
|
||||
id: input.definitionId,
|
||||
|
||||
Reference in new issue
Block a user