stream-chat-react-native-core 5.4.2 → 5.4.3-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/README.md CHANGED
@@ -9,9 +9,9 @@
9
9
 
10
10
 
11
11
  [![NPM](https://img.shields.io/npm/v/stream-chat-react-native.svg)](https://www.npmjs.com/package/stream-chat-react-native)
12
- [![Build Status](https://github.com/GetStream/stream-chat-react-native/workflows/test/badge.svg?branch=main)](https://github.com/GetStream/stream-chat-react-native/actions)
12
+ [![Build Status](https://github.com/GetStream/stream-chat-react-native/workflows/build/badge.svg)](https://github.com/GetStream/stream-chat-react-native/actions)
13
+ [![Test Status](https://github.com/GetStream/stream-chat-react-native/workflows/test/badge.svg)](https://github.com/GetStream/stream-chat-react-native/actions)
13
14
  [![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.io/chat/docs/sdk/reactnative)
14
- [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GetStream_stream-chat-react-native&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=GetStream_stream-chat-react-native)
15
15
 
16
16
  <img align="right" src="https://getstream.imgix.net/images/ios-chat-tutorial/iphone_chat_art@3x.png?auto=format,enhance" width="50%" />
17
17
 
@@ -65,7 +65,7 @@ var useAppSettings = function useAppSettings(client, isOnline) {
65
65
  return _getAppSettings.apply(this, arguments);
66
66
  }
67
67
 
68
- if (isOnline) {
68
+ if (isOnline && client.userID) {
69
69
  getAppSettings();
70
70
  }
71
71
 
@@ -1 +1 @@
1
- {"version":3,"sources":["useAppSettings.ts"],"names":["useAppSettings","client","isOnline","appSettings","setAppSettings","isMounted","getAppSettings","current","Error","console","error"],"mappings":";;;;;;;;;;;;;AAAA;;AAKO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAG5BC,MAH4B,EAI5BC,QAJ4B,EAKM;AAClC,kBAAsC,qBAAwC,IAAxC,CAAtC;AAAA;AAAA,MAAOC,WAAP;AAAA,MAAoBC,cAApB;;AACA,MAAMC,SAAS,GAAG,mBAAO,IAAP,CAAlB;AAEA,wBAAU,YAAM;AAAA,aACCC,cADD;AAAA;AAAA;;AAAA;AAAA,wFACd;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAE8BL,MAAM,CAACK,cAAP,EAF9B;;AAAA;AAEUH,gBAAAA,YAFV;;AAGI,oBAAIE,SAAS,CAACE,OAAd,EAAuB;AACrBH,kBAAAA,cAAc,CAACD,YAAD,CAAd;AACD;;AALL;AAAA;;AAAA;AAAA;AAAA;;AAOI,oBAAI,uBAAiBK,KAArB,EAA4B;AAC1BC,kBAAAA,OAAO,CAACC,KAAR;AACD;;AATL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OADc;AAAA;AAAA;;AAcd,QAAIR,QAAJ,EAAc;AACZI,MAAAA,cAAc;AACf;;AAED,WAAO,YAAM;AACXD,MAAAA,SAAS,CAACE,OAAV,GAAoB,KAApB;AACD,KAFD;AAGD,GArBD,EAqBG,CAACN,MAAD,EAASC,QAAT,CArBH;AAuBA,SAAOC,WAAP;AACD,CAjCM","sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport type { AppSettingsAPIResponse, StreamChat } from 'stream-chat';\nimport type { DefaultStreamChatGenerics } from 'stream-chat-react-native';\n\nexport const useAppSettings = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n client: StreamChat<StreamChatGenerics>,\n isOnline: boolean,\n): AppSettingsAPIResponse | null => {\n const [appSettings, setAppSettings] = useState<AppSettingsAPIResponse | null>(null);\n const isMounted = useRef(true);\n\n useEffect(() => {\n async function getAppSettings() {\n try {\n const appSettings = await client.getAppSettings();\n if (isMounted.current) {\n setAppSettings(appSettings);\n }\n } catch (error: unknown) {\n if (error instanceof Error) {\n console.error(`An error occurred while getting app settings: ${error}`);\n }\n }\n }\n\n if (isOnline) {\n getAppSettings();\n }\n\n return () => {\n isMounted.current = false;\n };\n }, [client, isOnline]);\n\n return appSettings;\n};\n"]}
1
+ {"version":3,"sources":["useAppSettings.ts"],"names":["useAppSettings","client","isOnline","appSettings","setAppSettings","isMounted","getAppSettings","current","Error","console","error","userID"],"mappings":";;;;;;;;;;;;;AAAA;;AAKO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAG5BC,MAH4B,EAI5BC,QAJ4B,EAKM;AAClC,kBAAsC,qBAAwC,IAAxC,CAAtC;AAAA;AAAA,MAAOC,WAAP;AAAA,MAAoBC,cAApB;;AACA,MAAMC,SAAS,GAAG,mBAAO,IAAP,CAAlB;AAEA,wBAAU,YAAM;AAAA,aACCC,cADD;AAAA;AAAA;;AAAA;AAAA,wFACd;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAE8BL,MAAM,CAACK,cAAP,EAF9B;;AAAA;AAEUH,gBAAAA,YAFV;;AAGI,oBAAIE,SAAS,CAACE,OAAd,EAAuB;AACrBH,kBAAAA,cAAc,CAACD,YAAD,CAAd;AACD;;AALL;AAAA;;AAAA;AAAA;AAAA;;AAOI,oBAAI,uBAAiBK,KAArB,EAA4B;AAC1BC,kBAAAA,OAAO,CAACC,KAAR;AACD;;AATL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OADc;AAAA;AAAA;;AAcd,QAAIR,QAAQ,IAAID,MAAM,CAACU,MAAvB,EAA+B;AAC7BL,MAAAA,cAAc;AACf;;AAED,WAAO,YAAM;AACXD,MAAAA,SAAS,CAACE,OAAV,GAAoB,KAApB;AACD,KAFD;AAGD,GArBD,EAqBG,CAACN,MAAD,EAASC,QAAT,CArBH;AAuBA,SAAOC,WAAP;AACD,CAjCM","sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport type { AppSettingsAPIResponse, StreamChat } from 'stream-chat';\nimport type { DefaultStreamChatGenerics } from 'stream-chat-react-native';\n\nexport const useAppSettings = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n client: StreamChat<StreamChatGenerics>,\n isOnline: boolean,\n): AppSettingsAPIResponse | null => {\n const [appSettings, setAppSettings] = useState<AppSettingsAPIResponse | null>(null);\n const isMounted = useRef(true);\n\n useEffect(() => {\n async function getAppSettings() {\n try {\n const appSettings = await client.getAppSettings();\n if (isMounted.current) {\n setAppSettings(appSettings);\n }\n } catch (error: unknown) {\n if (error instanceof Error) {\n console.error(`An error occurred while getting app settings: ${error}`);\n }\n }\n }\n\n if (isOnline && client.userID) {\n getAppSettings();\n }\n\n return () => {\n isMounted.current = false;\n };\n }, [client, isOnline]);\n\n return appSettings;\n};\n"]}
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "5.4.2"
2
+ "version": "5.4.3-beta.1"
3
3
  }
@@ -65,7 +65,7 @@ var useAppSettings = function useAppSettings(client, isOnline) {
65
65
  return _getAppSettings.apply(this, arguments);
66
66
  }
67
67
 
68
- if (isOnline) {
68
+ if (isOnline && client.userID) {
69
69
  getAppSettings();
70
70
  }
71
71
 
@@ -1 +1 @@
1
- {"version":3,"sources":["useAppSettings.ts"],"names":["useAppSettings","client","isOnline","appSettings","setAppSettings","isMounted","getAppSettings","current","Error","console","error"],"mappings":";;;;;;;;;;;;;AAAA;;AAKO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAG5BC,MAH4B,EAI5BC,QAJ4B,EAKM;AAClC,kBAAsC,qBAAwC,IAAxC,CAAtC;AAAA;AAAA,MAAOC,WAAP;AAAA,MAAoBC,cAApB;;AACA,MAAMC,SAAS,GAAG,mBAAO,IAAP,CAAlB;AAEA,wBAAU,YAAM;AAAA,aACCC,cADD;AAAA;AAAA;;AAAA;AAAA,wFACd;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAE8BL,MAAM,CAACK,cAAP,EAF9B;;AAAA;AAEUH,gBAAAA,YAFV;;AAGI,oBAAIE,SAAS,CAACE,OAAd,EAAuB;AACrBH,kBAAAA,cAAc,CAACD,YAAD,CAAd;AACD;;AALL;AAAA;;AAAA;AAAA;AAAA;;AAOI,oBAAI,uBAAiBK,KAArB,EAA4B;AAC1BC,kBAAAA,OAAO,CAACC,KAAR;AACD;;AATL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OADc;AAAA;AAAA;;AAcd,QAAIR,QAAJ,EAAc;AACZI,MAAAA,cAAc;AACf;;AAED,WAAO,YAAM;AACXD,MAAAA,SAAS,CAACE,OAAV,GAAoB,KAApB;AACD,KAFD;AAGD,GArBD,EAqBG,CAACN,MAAD,EAASC,QAAT,CArBH;AAuBA,SAAOC,WAAP;AACD,CAjCM","sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport type { AppSettingsAPIResponse, StreamChat } from 'stream-chat';\nimport type { DefaultStreamChatGenerics } from 'stream-chat-react-native';\n\nexport const useAppSettings = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n client: StreamChat<StreamChatGenerics>,\n isOnline: boolean,\n): AppSettingsAPIResponse | null => {\n const [appSettings, setAppSettings] = useState<AppSettingsAPIResponse | null>(null);\n const isMounted = useRef(true);\n\n useEffect(() => {\n async function getAppSettings() {\n try {\n const appSettings = await client.getAppSettings();\n if (isMounted.current) {\n setAppSettings(appSettings);\n }\n } catch (error: unknown) {\n if (error instanceof Error) {\n console.error(`An error occurred while getting app settings: ${error}`);\n }\n }\n }\n\n if (isOnline) {\n getAppSettings();\n }\n\n return () => {\n isMounted.current = false;\n };\n }, [client, isOnline]);\n\n return appSettings;\n};\n"]}
1
+ {"version":3,"sources":["useAppSettings.ts"],"names":["useAppSettings","client","isOnline","appSettings","setAppSettings","isMounted","getAppSettings","current","Error","console","error","userID"],"mappings":";;;;;;;;;;;;;AAAA;;AAKO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAG5BC,MAH4B,EAI5BC,QAJ4B,EAKM;AAClC,kBAAsC,qBAAwC,IAAxC,CAAtC;AAAA;AAAA,MAAOC,WAAP;AAAA,MAAoBC,cAApB;;AACA,MAAMC,SAAS,GAAG,mBAAO,IAAP,CAAlB;AAEA,wBAAU,YAAM;AAAA,aACCC,cADD;AAAA;AAAA;;AAAA;AAAA,wFACd;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAE8BL,MAAM,CAACK,cAAP,EAF9B;;AAAA;AAEUH,gBAAAA,YAFV;;AAGI,oBAAIE,SAAS,CAACE,OAAd,EAAuB;AACrBH,kBAAAA,cAAc,CAACD,YAAD,CAAd;AACD;;AALL;AAAA;;AAAA;AAAA;AAAA;;AAOI,oBAAI,uBAAiBK,KAArB,EAA4B;AAC1BC,kBAAAA,OAAO,CAACC,KAAR;AACD;;AATL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OADc;AAAA;AAAA;;AAcd,QAAIR,QAAQ,IAAID,MAAM,CAACU,MAAvB,EAA+B;AAC7BL,MAAAA,cAAc;AACf;;AAED,WAAO,YAAM;AACXD,MAAAA,SAAS,CAACE,OAAV,GAAoB,KAApB;AACD,KAFD;AAGD,GArBD,EAqBG,CAACN,MAAD,EAASC,QAAT,CArBH;AAuBA,SAAOC,WAAP;AACD,CAjCM","sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport type { AppSettingsAPIResponse, StreamChat } from 'stream-chat';\nimport type { DefaultStreamChatGenerics } from 'stream-chat-react-native';\n\nexport const useAppSettings = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n client: StreamChat<StreamChatGenerics>,\n isOnline: boolean,\n): AppSettingsAPIResponse | null => {\n const [appSettings, setAppSettings] = useState<AppSettingsAPIResponse | null>(null);\n const isMounted = useRef(true);\n\n useEffect(() => {\n async function getAppSettings() {\n try {\n const appSettings = await client.getAppSettings();\n if (isMounted.current) {\n setAppSettings(appSettings);\n }\n } catch (error: unknown) {\n if (error instanceof Error) {\n console.error(`An error occurred while getting app settings: ${error}`);\n }\n }\n }\n\n if (isOnline && client.userID) {\n getAppSettings();\n }\n\n return () => {\n isMounted.current = false;\n };\n }, [client, isOnline]);\n\n return appSettings;\n};\n"]}
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "5.4.2"
2
+ "version": "5.4.3-beta.1"
3
3
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stream-chat-react-native-core",
3
3
  "description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
4
- "version": "5.4.2",
4
+ "version": "5.4.3-beta.1",
5
5
  "author": {
6
6
  "company": "Stream.io Inc",
7
7
  "name": "Stream.io Inc"
@@ -18,6 +18,7 @@ describe('useAppSettings', () => {
18
18
  auto_translation_enabled: true,
19
19
  }),
20
20
  ),
21
+ userID: 'some-user-id',
21
22
  } as unknown as StreamChat,
22
23
  isOnline,
23
24
  );
@@ -26,7 +26,7 @@ export const useAppSettings = <
26
26
  }
27
27
  }
28
28
 
29
- if (isOnline) {
29
+ if (isOnline && client.userID) {
30
30
  getAppSettings();
31
31
  }
32
32
 
package/src/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "5.4.2"
2
+ "version": "5.4.3-beta.1"
3
3
  }