fix saving issue (#5328)

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Carina Wollendorfer
2022-11-02 10:06:08 +00:00
committed by GitHub
co-authored by CarinaWolli kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent f34d6e3c17
commit 0959cf7cd5
2 changed files with 3 additions and 4 deletions
@@ -40,7 +40,7 @@ export const TimeTimeUnitInput = (props: Props) => {
<div>
<Dropdown>
<DropdownMenuTrigger asChild>
<button className="-ml-1 h-9 w-24 rounded-r-md border border-gray-300 bg-gray-50 px-3 py-1 text-sm">
<button className="-ml-1 h-9 w-24 rounded-none rounded-r-md border border-gray-300 bg-gray-50 px-3 py-1 text-sm">
<div className="flex">
<div className="w-3/4">
{timeUnit ? t(`${timeUnit.toLowerCase()}_timeUnit`) : "undefined"}{" "}
@@ -85,13 +85,12 @@ function WorkflowPage() {
data: workflow,
isError,
error,
dataUpdatedAt,
} = trpc.useQuery(["viewer.workflows.get", { id: +workflowId }], {
enabled: router.isReady && !!workflowId,
});
useEffect(() => {
if (workflow && !form.getValues("trigger")) {
if (workflow) {
setSelectedEventTypes(
workflow.activeOn.map((active) => ({
value: String(active.eventType.id),
@@ -131,7 +130,7 @@ function WorkflowPage() {
form.setValue("activeOn", activeOn || []);
setIsAllDataLoaded(true);
}
}, [dataUpdatedAt]);
}, [workflow]);
const updateMutation = trpc.useMutation("viewer.workflows.update", {
onSuccess: async ({ workflow }) => {