From a042e6528728584633f54aa3804ba20b6197ac57 Mon Sep 17 00:00:00 2001 From: Weitian Li Date: Mon, 23 Dec 2019 16:15:39 +0800 Subject: [PATCH 1/3] fix bug --- .../packages/client/src/CreationFlow/CreateOptions/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Composer/packages/client/src/CreationFlow/CreateOptions/index.js b/Composer/packages/client/src/CreationFlow/CreateOptions/index.js index 93203bf763..50c7c731f1 100644 --- a/Composer/packages/client/src/CreationFlow/CreateOptions/index.js +++ b/Composer/packages/client/src/CreationFlow/CreateOptions/index.js @@ -72,10 +72,10 @@ export function CreateOptions(props) { const handleJumpToNext = () => { if (option === 'Create from template') { - if (template === null) onNext(templates[0]); + if (template === null) onNext(templates[1].key); else onNext(template.key); } else { - onNext(null); + onNext(templates[1].key); } }; From e174bc3393a6fe025514ef689357e95a3e68ee25 Mon Sep 17 00:00:00 2001 From: liweitian Date: Fri, 27 Dec 2019 16:13:43 +0800 Subject: [PATCH 2/3] handle comments --- .../client/src/CreationFlow/CreateOptions/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Composer/packages/client/src/CreationFlow/CreateOptions/index.js b/Composer/packages/client/src/CreationFlow/CreateOptions/index.js index 50c7c731f1..40f6090ee2 100644 --- a/Composer/packages/client/src/CreationFlow/CreateOptions/index.js +++ b/Composer/packages/client/src/CreationFlow/CreateOptions/index.js @@ -14,9 +14,9 @@ import { choiceGroup, templateItem, optionRoot, optionIcon, placeholder } from ' export function CreateOptions(props) { const [option, setOption] = useState('create'); - const [template, setTemplate] = useState(null); const { templates, onDismiss, onNext } = props; - + const emptyBotKey = templates[1].id; + const [template, setTemplate] = useState(emptyBotKey); function SelectOption(props) { const { checked, text, key } = props; return ( @@ -72,10 +72,9 @@ export function CreateOptions(props) { const handleJumpToNext = () => { if (option === 'Create from template') { - if (template === null) onNext(templates[1].key); - else onNext(template.key); + onNext(template.key); } else { - onNext(templates[1].key); + onNext(emptyBotKey); } }; From 955d4a03d95910f1903e0d0d8ab18961d00b1936 Mon Sep 17 00:00:00 2001 From: Weitian Li Date: Mon, 30 Dec 2019 14:08:51 +0800 Subject: [PATCH 3/3] handle comments --- .../packages/client/src/CreationFlow/CreateOptions/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Composer/packages/client/src/CreationFlow/CreateOptions/index.js b/Composer/packages/client/src/CreationFlow/CreateOptions/index.js index 40f6090ee2..a6fd0e80bd 100644 --- a/Composer/packages/client/src/CreationFlow/CreateOptions/index.js +++ b/Composer/packages/client/src/CreationFlow/CreateOptions/index.js @@ -67,12 +67,12 @@ export function CreateOptions(props) { }; const handleItemChange = (event, option) => { - setTemplate(option); + setTemplate(option.key); }; const handleJumpToNext = () => { if (option === 'Create from template') { - onNext(template.key); + onNext(template); } else { onNext(emptyBotKey); }