File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 7
7
8
8
onMount (async () => {
9
9
Talk .ready .then (() => {
10
- const me = new Talk.User (oliver);
11
- const other = new Talk.User (abby);
10
+ const session = new Talk.Session ({
11
+ appId: appId,
12
+ userId: oliver .id ,
13
+ });
14
+ session .currentUser .createIfNotExists (oliver);
12
15
13
- const session = new Talk.Session ({ appId, me });
16
+ const otherRef = session .user (abby .id );
17
+ otherRef .createIfNotExists (abby);
14
18
15
- const conversationId = Talk .oneOnOneId (me, other);
16
- const conversation = session .getOrCreateConversation (conversationId);
17
- conversation .setParticipant (me);
18
- conversation .setParticipant (other);
19
+ const conversationRef = session .conversation (' svelte_example_conversation' );
20
+ conversationRef .createIfNotExists ();
21
+ conversationRef .participant (otherRef).createIfNotExists ();
19
22
20
23
const chatbox = session .createChatbox ();
21
- chatbox .select (conversation );
24
+ chatbox .select (conversationRef );
22
25
chatbox .mount (element);
23
26
});
24
27
});
You can’t perform that action at this time.
0 commit comments