Skip to content

Commit 2a50604

Browse files
authored
Merge pull request #2758 from GetStream/develop
Next Release
2 parents 0a4c852 + a7dd5a3 commit 2a50604

File tree

7 files changed

+38
-6
lines changed

7 files changed

+38
-6
lines changed

examples/SampleApp/Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ GEM
163163
google-apis-firebaseappdistribution_v1 (~> 0.3.0)
164164
google-apis-firebaseappdistribution_v1alpha (~> 0.2.0)
165165
fastlane-plugin-load_json (0.0.1)
166-
fastlane-plugin-stream_actions (0.3.69)
166+
fastlane-plugin-stream_actions (0.3.73)
167167
xctest_list (= 1.2.1)
168168
ffi (1.17.0)
169169
fourflusher (2.3.1)
@@ -320,7 +320,7 @@ DEPENDENCIES
320320
fastlane
321321
fastlane-plugin-firebase_app_distribution
322322
fastlane-plugin-load_json
323-
fastlane-plugin-stream_actions (= 0.3.69)
323+
fastlane-plugin-stream_actions (= 0.3.73)
324324
rubocop-performance
325325
rubocop-require_tools
326326

examples/SampleApp/fastlane/Pluginfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
gem 'fastlane-plugin-firebase_app_distribution'
66
gem 'fastlane-plugin-load_json'
7-
gem 'fastlane-plugin-stream_actions', '0.3.69'
7+
gem 'fastlane-plugin-stream_actions', '0.3.73'

package/src/contexts/messageInputContext/MessageInputContext.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,8 @@ export const MessageInputProvider = <
538538
setSelectedImages,
539539
setSelectedPicker,
540540
} = useAttachmentPickerContext();
541-
const { appSettings, client, enableOfflineSupport } = useChatContext<StreamChatGenerics>();
541+
const { appSettings, client, enableOfflineSupport, isOnline } =
542+
useChatContext<StreamChatGenerics>();
542543
const { removeMessage } = useMessagesContext();
543544

544545
const getFileUploadConfig = () => {
@@ -652,7 +653,7 @@ export const MessageInputProvider = <
652653
}
653654
setText(newText);
654655

655-
if (newText && channel && channelCapabities.sendTypingEvents) {
656+
if (newText && channel && channelCapabities.sendTypingEvents && isOnline) {
656657
logChatPromiseExecution(channel.keystroke(thread?.id), 'start typing event');
657658
}
658659

package/src/contexts/messageInputContext/__tests__/pickFile.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe("MessageInputContext's pickFile", () => {
6161
maxNumberOfFiles: 2,
6262
};
6363

64-
it.each([[3, 2]])(
64+
it.each([[3, 1]])(
6565
'run pickFile when numberOfUploads is %d and alert is triggered %d number of times',
6666
async (numberOfUploads, numberOfTimesCalled) => {
6767
const { rerender, result } = renderHook(() => useMessageInputContext(), {
@@ -87,6 +87,7 @@ describe("MessageInputContext's pickFile", () => {
8787
});
8888

8989
expect(Alert.alert).toHaveBeenCalledTimes(numberOfTimesCalled);
90+
expect(Alert.alert).toHaveBeenCalledWith('Maximum number of files reached');
9091
},
9192
);
9293

package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ export const useCreateMessageInputContext = <
258258
text,
259259
threadId,
260260
showPollCreationDialog,
261+
onChange,
261262
],
262263
);
263264

package/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/** i18next polyfill to handle intl format for pluralization. For more info see https://www.i18next.com/misc/json-format#i-18-next-json-v4 */
22
import 'intl-pluralrules';
3+
import './polyfills';
34

45
export * from './components';
56
export * from './hooks';

package/src/polyfills.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
(function () {
2+
if (!Array.prototype.at) {
3+
// eslint-disable-next-line no-extend-native
4+
Object.defineProperty(Array.prototype, 'at', {
5+
configurable: true,
6+
enumerable: false,
7+
value: function at(index: number) {
8+
// Convert to integer if index is not provided
9+
const len = this.length;
10+
let relativeIndex = Number(index) || 0;
11+
12+
// Handle negative indices
13+
if (relativeIndex < 0) {
14+
relativeIndex += len;
15+
}
16+
17+
// Return undefined if index is out of bounds
18+
if (relativeIndex < 0 || relativeIndex >= len) {
19+
return undefined;
20+
}
21+
22+
// Return the element at the calculated index
23+
return this[relativeIndex];
24+
},
25+
writable: true,
26+
});
27+
}
28+
})();

0 commit comments

Comments
 (0)