Skip to content

Commit 01f64c8

Browse files
authored
1 parent 77e757d commit 01f64c8

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

packages/front-end/components/Share/ShareModal.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React, { useEffect } from "react";
22
import PagedModal from "../Modal/PagedModal";
33
import Page from "../Modal/Page";
44
import { useState } from "react";
@@ -199,6 +199,26 @@ const ShareModal = ({
199199
},
200200
});
201201

202+
useEffect(() => {
203+
if (existing?.slides) {
204+
const newVal = {
205+
...form.getValues(),
206+
title: existing?.title || "A/B Test Review",
207+
description: existing?.description || date(new Date()),
208+
theme: existing?.theme || defaultTheme,
209+
customTheme: existing?.customTheme || {
210+
backgroundColor: "#3400a3",
211+
textColor: "#ffffff",
212+
headingFont: '"Helvetica Neue", Helvetica, Arial, sans-serif',
213+
bodyFont: '"Helvetica Neue", Helvetica, Arial, sans-serif',
214+
},
215+
slides: existing?.slides || [],
216+
sharable: existing?.sharable || true,
217+
};
218+
form.reset(newVal);
219+
}
220+
}, [existing?.slides]);
221+
202222
const {
203223
list: experiments,
204224
searchInputProps,

0 commit comments

Comments
 (0)