@seamly/web-ui 22.3.0 → 22.3.2-beta.1

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": "22.3.0",
3
+ "version": "22.3.2-beta.1",
4
4
  "main": "build/dist/lib/index.js",
5
5
  "types": "build/src/javascripts/index.d.ts",
6
6
  "module": "",
@@ -29,7 +29,7 @@ export default class ConversationConnector {
29
29
 
30
30
  url: string
31
31
 
32
- socket: Socket
32
+ socket?: Socket
33
33
 
34
34
  channel: Channel
35
35
 
@@ -46,10 +46,11 @@ export default class ConversationConnector {
46
46
  this.channelTopic = channelTopic
47
47
  const { url: splittedUrl, params } = splitUrlParams(this.url)
48
48
 
49
- if (!this.socket) {
49
+ if (!this.socket?.isConnected()) {
50
50
  this.socket = new Socket(splittedUrl, {
51
51
  params: { ...params, v: apiVersion },
52
52
  })
53
+
53
54
  this.socket.connect()
54
55
  }
55
56
 
@@ -147,6 +148,7 @@ export default class ConversationConnector {
147
148
 
148
149
  disconnect() {
149
150
  this.channel?.leave().receive('ok', () => {
151
+ this.socket?.disconnect()
150
152
  log('[CHANNEL][LEAVE] OK')
151
153
  this.#connectionListeners = []
152
154
  })
@@ -657,8 +657,9 @@ export const storeSlice = createSlice({
657
657
  state.options.features = payload.features
658
658
  })
659
659
  .addCase(initializeApp.fulfilled, (state, { payload }) => {
660
- if (!payload.initialState) return
661
660
  state.isLoading = false
661
+
662
+ if (!payload.initialState) return
662
663
  state.initialState = payload.initialState
663
664
  })
664
665
  .addMatcher(