stream-chat-react-native 9.7.3-beta.3 → 9.7.3-beta.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stream-chat-react-native",
3
3
  "description": "The official React Native SDK for Stream Chat, a service for building chat applications",
4
- "version": "9.7.3-beta.3",
4
+ "version": "9.7.3-beta.4",
5
5
  "homepage": "https://www.npmjs.com/package/stream-chat-react-native",
6
6
  "author": {
7
7
  "company": "Stream.io Inc",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "es6-symbol": "^3.1.3",
32
32
  "mime": "^4.0.7",
33
- "stream-chat-react-native-core": "9.7.3-beta.3"
33
+ "stream-chat-react-native-core": "9.7.3-beta.4"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@react-native-camera-roll/camera-roll": ">=7.9.0",
@@ -1,4 +1,9 @@
1
- let Clipboard: { setString: (string: string) => void } | undefined;
1
+ type SetClipboardStringOptions = {
2
+ onFailure?: (error: unknown) => void;
3
+ onSuccess?: () => void;
4
+ };
5
+
6
+ let Clipboard: { setString?: (text: string) => void } | undefined;
2
7
 
3
8
  try {
4
9
  Clipboard = require('@react-native-clipboard/clipboard').default;
@@ -7,6 +12,14 @@ try {
7
12
  console.log('@react-native-clipboard/clipboard is not installed');
8
13
  }
9
14
 
10
- export const setClipboardString = Clipboard
11
- ? (string: string) => (Clipboard ? Clipboard.setString(string) : {})
15
+ export const setClipboardString = Clipboard?.setString
16
+ ? (text: string, options?: SetClipboardStringOptions) => {
17
+ try {
18
+ Clipboard?.setString?.(text);
19
+ options?.onSuccess?.();
20
+ } catch (error) {
21
+ console.log('Copying to clipboard failed...', error);
22
+ options?.onFailure?.(error);
23
+ }
24
+ }
12
25
  : null;