Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 64091a9

Browse files
committed
feat: make it works with startling
1 parent c0ca623 commit 64091a9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/app/[lang]/chatgpt-startling-by-each-step/[id]/StartlingStepDetail.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ type AskRendererProps = { step: StepDetail; onAskUpdate: (ask: string) => void;
2727

2828
function AskRenderer({ step, onAskUpdate, cachedValue }: AskRendererProps) {
2929
const askTask = fillStepWithValued(step, cachedValue);
30+
31+
useEffect(() => {
32+
onAskUpdate(askTask.ask);
33+
});
34+
3035
if (askTask.replaced) {
3136
return (
3237
<Textarea
@@ -40,7 +45,6 @@ function AskRenderer({ step, onAskUpdate, cachedValue }: AskRendererProps) {
4045
);
4146
}
4247

43-
onAskUpdate(askTask.ask);
4448
return <SimpleMarkdown content={step.ask} />;
4549
}
4650

src/components/ClickPrompt/ExecutePromptButton.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ function ExecutePromptButton(props: ExecButtonProps) {
3434
setIsLoading(true);
3535

3636
try {
37-
const response = await UserAPI.isLoggedIn();
38-
if (!response.loggedIn) {
37+
const isLoggedIn = await UserAPI.isLoggedIn();
38+
if (!isLoggedIn) {
3939
onOpen();
4040
setIsLoading(false);
4141
return;
4242
}
43-
44-
setHasLogin(true);
4543
} catch (e) {
4644
console.log(e);
4745
setHasLogin(false);

0 commit comments

Comments
 (0)