@seamly/web-ui 22.3.2 → 22.3.4
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/components.js +1 -1
- package/build/dist/lib/components.js.map +1 -1
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/components.min.js.map +1 -1
- 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 +14 -5
- 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 +14 -5
- 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 +14 -5
- 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 +14 -5
- 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 +2 -2
- package/src/javascripts/api/conversation-connector.ts +12 -1
- package/src/javascripts/ui/hooks/use-notifications.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamly/web-ui",
|
|
3
|
-
"version": "22.3.
|
|
3
|
+
"version": "22.3.4",
|
|
4
4
|
"main": "build/dist/lib/index.js",
|
|
5
5
|
"types": "build/src/javascripts/index.d.ts",
|
|
6
6
|
"module": "",
|
|
@@ -134,4 +134,4 @@
|
|
|
134
134
|
"test:e2e:coverage": "yarn nyc report --reporter cobertura --reporter html",
|
|
135
135
|
"prepare": "husky install"
|
|
136
136
|
}
|
|
137
|
-
}
|
|
137
|
+
}
|
|
@@ -46,11 +46,22 @@ 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) {
|
|
50
50
|
this.socket = new Socket(splittedUrl, {
|
|
51
51
|
params: { ...params, v: apiVersion },
|
|
52
|
+
reconnectAfterMs: (tries) => {
|
|
53
|
+
// Calculate the backoff time based on the number of tries.
|
|
54
|
+
const backoff = 2 ** tries * 250
|
|
55
|
+
|
|
56
|
+
// Limit the backoff time to 10 seconds.
|
|
57
|
+
return Math.min(backoff, 10000)
|
|
58
|
+
},
|
|
52
59
|
})
|
|
60
|
+
}
|
|
53
61
|
|
|
62
|
+
// Checks if the socket is not already connected before attempting a connection.
|
|
63
|
+
// This prevents multiple connection attempts during server reconnects, network switches or SPA route changes.
|
|
64
|
+
if (!this.socket.isConnected()) {
|
|
54
65
|
this.socket.connect()
|
|
55
66
|
}
|
|
56
67
|
|
|
@@ -22,7 +22,7 @@ const useNotification = () => {
|
|
|
22
22
|
const showNotifications = useSelector(selectShowNotifications)
|
|
23
23
|
|
|
24
24
|
const requestPermission = useCallback(async () => {
|
|
25
|
-
if (
|
|
25
|
+
if (hasNotificationSupport && permission !== 'granted') {
|
|
26
26
|
const notificationPermission = await Notification.requestPermission()
|
|
27
27
|
setPermission(notificationPermission)
|
|
28
28
|
}
|