stream-chat-react 12.11.0 → 12.11.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.
|
@@ -120,6 +120,10 @@ export const useChannelListShapeDefaults = () => {
|
|
|
120
120
|
const channelId = event.channel_id;
|
|
121
121
|
const considerPinnedChannels = shouldConsiderPinnedChannels(sort);
|
|
122
122
|
const considerArchivedChannels = shouldConsiderArchivedChannels(filters);
|
|
123
|
+
// `pinned_at` nor `archived` properties are set or channel list order is locked, return early
|
|
124
|
+
if ((!considerPinnedChannels && !considerArchivedChannels) || lockChannelOrder) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
123
127
|
const pinnedAtSort = extractSortValue({ atIndex: 0, sort, targetKey: 'pinned_at' });
|
|
124
128
|
setChannels((currentChannels) => {
|
|
125
129
|
const targetChannel = client.channel(channelType, channelId);
|
|
@@ -128,9 +132,6 @@ export const useChannelListShapeDefaults = () => {
|
|
|
128
132
|
const targetChannelExistsWithinList = targetChannelIndex >= 0;
|
|
129
133
|
const isTargetChannelArchived = isChannelArchived(targetChannel);
|
|
130
134
|
const isTargetChannelPinned = isChannelPinned(targetChannel);
|
|
131
|
-
// handle pinning
|
|
132
|
-
if (!considerPinnedChannels || lockChannelOrder)
|
|
133
|
-
return currentChannels;
|
|
134
135
|
const newChannels = [...currentChannels];
|
|
135
136
|
if (targetChannelExistsWithinList) {
|
|
136
137
|
newChannels.splice(targetChannelIndex, 1);
|
|
@@ -28,7 +28,7 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
|
|
|
28
28
|
if (!userAgent.includes('stream-chat-react')) {
|
|
29
29
|
// result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
|
|
30
30
|
// the upper-case text between double underscores is replaced with the actual semantic version of the library
|
|
31
|
-
client.setUserAgent(`stream-chat-react-12.11.
|
|
31
|
+
client.setUserAgent(`stream-chat-react-12.11.1-${userAgent}`);
|
|
32
32
|
}
|
|
33
33
|
client.threads.registerSubscriptions();
|
|
34
34
|
client.polls.registerSubscriptions();
|
package/dist/index.browser.cjs
CHANGED
|
@@ -41801,6 +41801,9 @@ var useChannelListShapeDefaults = () => {
|
|
|
41801
41801
|
const channelId = event.channel_id;
|
|
41802
41802
|
const considerPinnedChannels = shouldConsiderPinnedChannels(sort);
|
|
41803
41803
|
const considerArchivedChannels = shouldConsiderArchivedChannels(filters);
|
|
41804
|
+
if (!considerPinnedChannels && !considerArchivedChannels || lockChannelOrder) {
|
|
41805
|
+
return;
|
|
41806
|
+
}
|
|
41804
41807
|
const pinnedAtSort = extractSortValue({ atIndex: 0, sort, targetKey: "pinned_at" });
|
|
41805
41808
|
setChannels((currentChannels) => {
|
|
41806
41809
|
const targetChannel = client.channel(channelType, channelId);
|
|
@@ -41808,7 +41811,6 @@ var useChannelListShapeDefaults = () => {
|
|
|
41808
41811
|
const targetChannelExistsWithinList = targetChannelIndex >= 0;
|
|
41809
41812
|
const isTargetChannelArchived = isChannelArchived(targetChannel);
|
|
41810
41813
|
const isTargetChannelPinned = isChannelPinned(targetChannel);
|
|
41811
|
-
if (!considerPinnedChannels || lockChannelOrder) return currentChannels;
|
|
41812
41814
|
const newChannels = [...currentChannels];
|
|
41813
41815
|
if (targetChannelExistsWithinList) {
|
|
41814
41816
|
newChannels.splice(targetChannelIndex, 1);
|
|
@@ -52030,7 +52032,7 @@ var useChat = ({
|
|
|
52030
52032
|
if (!client) return;
|
|
52031
52033
|
const userAgent = client.getUserAgent();
|
|
52032
52034
|
if (!userAgent.includes("stream-chat-react")) {
|
|
52033
|
-
client.setUserAgent(`stream-chat-react-12.11.
|
|
52035
|
+
client.setUserAgent(`stream-chat-react-12.11.1-${userAgent}`);
|
|
52034
52036
|
}
|
|
52035
52037
|
client.threads.registerSubscriptions();
|
|
52036
52038
|
client.polls.registerSubscriptions();
|