@seamly/web-ui 24.0.0-beta.8 → 24.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamly/web-ui",
3
- "version": "24.0.0-beta.8",
3
+ "version": "24.0.0",
4
4
  "main": "build/dist/lib/index.js",
5
5
  "types": "build/src/javascripts/index.d.ts",
6
6
  "exports": {
@@ -28,6 +28,7 @@ import useSeamlyEventBusContext from 'ui/hooks/event-bus-hooks'
28
28
  import {
29
29
  useSeamlyCommands,
30
30
  useSeamlyIdleDetachCountdown,
31
+ useSeamlyResumeConversationPrompt,
31
32
  } from 'ui/hooks/seamly-hooks'
32
33
  import useSeamlyConversation from 'ui/hooks/use-seamly-conversation'
33
34
  import type { ChannelEvent } from 'domains/store/store.types'
@@ -44,6 +45,12 @@ const SeamlyEventSubscriber = () => {
44
45
  const prevEmittedEventId = useRef(null)
45
46
  const { initCountdown, endCountdown } = useSeamlyIdleDetachCountdown()
46
47
  const { emitEvent } = useSeamlyCommands()
48
+ const { hasPrompt, continueChat } = useSeamlyResumeConversationPrompt()
49
+ const hasResumeConversationPrompt = useRef(hasPrompt)
50
+
51
+ useEffect(() => {
52
+ hasResumeConversationPrompt.current = hasPrompt
53
+ }, [hasPrompt])
47
54
 
48
55
  useEffect(() => {
49
56
  if (conversation.socket) {
@@ -212,6 +219,10 @@ const SeamlyEventSubscriber = () => {
212
219
  break
213
220
  }
214
221
 
222
+ if (hasResumeConversationPrompt.current) {
223
+ continueChat()
224
+ }
225
+
215
226
  dispatch(addEvent(event as unknown as ChannelEvent))
216
227
 
217
228
  break
@@ -280,7 +291,15 @@ const SeamlyEventSubscriber = () => {
280
291
 
281
292
  return true
282
293
  })
283
- }, [conversation, dispatch, emitEvent, endCountdown, eventBus, initCountdown])
294
+ }, [
295
+ continueChat,
296
+ conversation,
297
+ dispatch,
298
+ emitEvent,
299
+ endCountdown,
300
+ eventBus,
301
+ initCountdown,
302
+ ])
284
303
 
285
304
  useEffect(() => {
286
305
  conversation.onConnection(({ connected }) => {