Skip to content

Commit

Permalink
chore: Update development flow
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed Nov 6, 2024
1 parent e97fec8 commit 93e205e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ function App() {
},
ask_height: {
message: "What is your height (cm)?",
path: (params: Params) => {
path: async (params: Params) => {
if (isNaN(Number(params.userInput))) {
params.injectMessage("Height needs to be a number!");
await params.injectMessage("Height needs to be a number!");
return;
}
return "ask_weather";
Expand Down Expand Up @@ -95,11 +95,11 @@ function App() {
</button>
</div>
),
path: (params: Params) => {
path: async (params: Params) => {
if (params.userInput.toLowerCase() != "black") {
return "incorrect_answer"
} else {
params.openChat(false);
await params.openChat(false);
return "close_chat";
}
},
Expand All @@ -121,8 +121,8 @@ function App() {
loop: {
message: (params: Params) => {
// sends the message half a second later to facilitate testing of new message prompt
setTimeout(() => {
params.injectMessage("You have reached the end of the conversation!");
setTimeout(async () => {
await params.injectMessage("You have reached the end of the conversation!");
}, 500)
},
path: "loop"
Expand Down

0 comments on commit 93e205e

Please sign in to comment.