@webitel/ui-chats 0.1.51 → 0.1.53

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": "@webitel/ui-chats",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "description": "Reusable Webitel Frontend Code for Chats UI",
5
5
  "workspaces": [
6
6
  "../../",
@@ -15,27 +15,27 @@ export function useChatMessageFile(
15
15
  return fileRef.value?.streamUrl || fileRef.value?.url;
16
16
  });
17
17
 
18
+ const isMediaType = (value: string | undefined) => {
19
+ return !!(value?.includes('audio') || value?.includes('video'));
20
+ };
21
+
18
22
  const image = computed(() => {
19
23
  const isImage = fileType.value?.includes('image');
20
24
  const isHEIC = fileType.value?.includes('heic');
21
25
 
22
26
  if (isHEIC) return null;
23
27
 
24
- return isImage && fileRef.value; //https://webitel.atlassian.net/browse/WTEL-6268
28
+ return isImage ? fileRef.value : null;
25
29
  });
30
+
26
31
  const media = computed(() => {
27
- return (
28
- (isMediaType(fileType.value) || isMediaType(fileSrc.value)) &&
29
- fileRef.value
30
- );
32
+ return isMediaType(fileType.value) || isMediaType(fileSrc.value)
33
+ ? fileRef.value
34
+ : null;
31
35
  });
32
36
 
33
- const isMediaType = (value: string | undefined) => {
34
- return !!(value?.includes('audio') || value?.includes('video'));
35
- };
36
-
37
37
  const document = computed(() => {
38
- return !media.value && !image.value && fileRef.value;
38
+ return !media.value && !image.value ? fileRef.value : null;
39
39
  });
40
40
 
41
41
  return {