Skip to content

Commit 74aa571

Browse files
refactor: moving setup part to Chat component
1 parent c77fc7b commit 74aa571

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

package/src/components/Chat/Chat.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
TranslationProvider,
1919
} from '../../contexts/translationContext/TranslationContext';
2020
import { useStreami18n } from '../../hooks/useStreami18n';
21+
import init from '../../init';
2122

2223
import { SDK } from '../../native';
2324
import type {
@@ -33,6 +34,8 @@ import type {
3334
import type { Streami18n } from '../../utils/Streami18n';
3435
import { version } from '../../version.json';
3536

37+
init();
38+
3639
export type ChatProps<
3740
At extends UnknownType = DefaultAttachmentType,
3841
Ch extends UnknownType = DefaultChannelType,

package/src/init.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { setupURLPolyfill } from 'react-native-url-polyfill';
2+
3+
export default () => {
4+
setupURLPolyfill();
5+
};

package/src/utils/getResizedImageUrl.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import { PixelRatio } from 'react-native';
2-
import { setupURLPolyfill } from 'react-native-url-polyfill';
3-
4-
setupURLPolyfill();
52

63
type GetResizedImageUrlParams = {
74
url: string;

0 commit comments

Comments
 (0)