@connectycube/chat-widget 0.30.2 → 0.31.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.31.0
4
+
5
+ ### Misc
6
+
7
+ - Uses the `<VList/>` component from the `virtua` scroll library
8
+ - Added infinite scroll to load and prepend earlier messages in chat history
9
+ - Added infinite scroll to load and append more dialogs in the chat list
10
+ - Updated messages styles and alignment
11
+ - Updated dialog list styles
12
+ - Can open the widget by clicking on the push notification
13
+
14
+ ### Fixed
15
+
16
+ - Playing stop call audio on app start
17
+
3
18
  ## 0.30.2
4
19
 
5
20
  ### Fixed
@@ -15,5 +15,30 @@ self.addEventListener('push', (event) => {
15
15
 
16
16
  self.addEventListener('notificationclick', (event) => {
17
17
  event.notification.close();
18
- event.waitUntil(clients.openWindow('/'));
18
+ event.waitUntil(
19
+ clients.matchAll({ type: 'window', includeUncontrolled: true }).then((clientList) => {
20
+ const matchedClient = clientList.find((client) =>
21
+ client.url.startsWith(self.location.origin) && 'focus' in client
22
+ );
23
+
24
+ if (matchedClient) {
25
+ matchedClient.focus();
26
+ } else {
27
+ clients.openWindow('/').then((chatWidget) => {
28
+ const payload = {
29
+ badge: event.notification.badge || '',
30
+ body: event.notification.body || '',
31
+ data: event.notification.data || null,
32
+ dir: event.notification.dir || '',
33
+ lang: event.notification.lang || '',
34
+ title: event.notification.title || '',
35
+ icon: event.notification.icon || '',
36
+ timestamp: event.notification.timestamp || Date.now(),
37
+ };
38
+
39
+ chatWidget?.postMessage({ action: 'connectycube-chat-widget-sw/initialNotification', payload });
40
+ });
41
+ }
42
+ })
43
+ );
19
44
  });