Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
chtrembl committed Nov 6, 2023
1 parent df61f40 commit ec2abc7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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' });
}
},
Expand Down

0 comments on commit ec2abc7

Please sign in to comment.