From ec2abc7ef6af2546391bc5875234ba36827ad4db Mon Sep 17 00:00:00 2001 From: Chris Tremblay Date: Mon, 6 Nov 2023 17:03:18 -0500 Subject: [PATCH] Update index.js --- .../petstoreapp/soulmachines-react-app/src/store/sm/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/petstore/petstoreapp/soulmachines-react-app/src/store/sm/index.js b/petstore/petstoreapp/soulmachines-react-app/src/store/sm/index.js index fa036b4b..2ff1b457 100644 --- a/petstore/petstoreapp/soulmachines-react-app/src/store/sm/index.js +++ b/petstore/petstoreapp/soulmachines-react-app/src/store/sm/index.js @@ -618,7 +618,7 @@ export const createScene = createAsyncThunk('sm/createScene', async (_, thunk) = export const sendTextMessage = createAsyncThunk('sm/sendTextMessage', async ({ text }, thunk) => { if (text === '') return thunk.rejectWithValue('submitted empty string!'); if (scene !== null && persona !== null) { - persona.conversationSetVariables({ sessionid: 'session id', csrftoken: 'csrf token' }); + persona.conversationSetVariables({ url: '${window.parent.location}'}); console.log(`${text} ${window.parent.location}`); persona.conversationSend(`${text} ${window.parent.location}`); return thunk.dispatch(actions.addConversationResult({ @@ -825,6 +825,8 @@ const smSlice = createSlice({ sendEvent: (state, { payload }) => { const { eventName, payload: eventPayload, kind } = payload; if (scene && persona) { + persona.conversationSetVariables({ url: '${window.parent.location}'}); + console.log(`${eventName} ${eventPayload} ${window.parent.location}`); persona.conversationSend(eventName, eventPayload || {}, { kind: kind || 'event' }); } },