@seamly/web-ui 22.3.0-beta.2 → 22.3.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/build/dist/lib/index.debug.js +3 -3
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +28 -27
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +29 -28
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +28 -27
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/utils.js +28 -27
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +1 -1
- package/src/javascripts/api/conversation-connector.ts +6 -9
- package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +20 -15
package/package.json
CHANGED
|
@@ -46,11 +46,12 @@ export default class ConversationConnector {
|
|
|
46
46
|
this.channelTopic = channelTopic
|
|
47
47
|
const { url: splittedUrl, params } = splitUrlParams(this.url)
|
|
48
48
|
|
|
49
|
-
this.socket
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
if (!this.socket) {
|
|
50
|
+
this.socket = new Socket(splittedUrl, {
|
|
51
|
+
params: { ...params, v: apiVersion },
|
|
52
|
+
})
|
|
53
|
+
this.socket.connect()
|
|
54
|
+
}
|
|
54
55
|
|
|
55
56
|
this.channel = this.socket.channel(this.channelTopic, {
|
|
56
57
|
authorization: `Bearer ${this.accessToken}`,
|
|
@@ -138,8 +139,6 @@ export default class ConversationConnector {
|
|
|
138
139
|
ready: false,
|
|
139
140
|
currentState: 'join_channel_erred',
|
|
140
141
|
})
|
|
141
|
-
// @ts-ignore
|
|
142
|
-
this.channel.socket.disconnect()
|
|
143
142
|
})
|
|
144
143
|
.receive('timeout', () => {
|
|
145
144
|
log('[CHANEL][JOIN] Networking issue. Still waiting...')
|
|
@@ -149,8 +148,6 @@ export default class ConversationConnector {
|
|
|
149
148
|
disconnect() {
|
|
150
149
|
this.channel?.leave().receive('ok', () => {
|
|
151
150
|
log('[CHANNEL][LEAVE] OK')
|
|
152
|
-
this.socket?.remove(this.channel)
|
|
153
|
-
this.socket?.disconnect()
|
|
154
151
|
this.#connectionListeners = []
|
|
155
152
|
})
|
|
156
153
|
}
|
|
@@ -71,21 +71,26 @@ const SeamlyEventSubscriber = () => {
|
|
|
71
71
|
}, [api, api.connectionInfo, api.conversation.socket, dispatch])
|
|
72
72
|
|
|
73
73
|
useEffect(() => {
|
|
74
|
-
api.conversation.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
if (api.connectionInfo && api.conversation.socket) {
|
|
75
|
+
api.conversation.onConnection(({ currentState }) => {
|
|
76
|
+
if (currentState === 'join_channel_erred') {
|
|
77
|
+
const seamlyGeneralError = new SeamlyGeneralError()
|
|
78
|
+
dispatch(
|
|
79
|
+
setInterrupt({
|
|
80
|
+
name: seamlyGeneralError.name,
|
|
81
|
+
message: seamlyGeneralError.message,
|
|
82
|
+
langKey: seamlyGeneralError.langKey,
|
|
83
|
+
originalEvent: seamlyGeneralError.originalEvent,
|
|
84
|
+
originalError: seamlyGeneralError.originalError,
|
|
85
|
+
action: seamlyGeneralError.action,
|
|
86
|
+
}),
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
return true
|
|
90
|
+
}
|
|
91
|
+
return false
|
|
92
|
+
})
|
|
93
|
+
}
|
|
89
94
|
}, [api, api.connectionInfo, api.conversation.channel, dispatch])
|
|
90
95
|
|
|
91
96
|
useEffect(() => {
|