l-min-components 1.6.1232 → 1.6.1233
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
|
@@ -765,32 +765,31 @@ const useMessageKit = (/*affiliatesActive*/) => {
|
|
|
765
765
|
}),
|
|
766
766
|
};
|
|
767
767
|
});
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
if (!response?.data) {
|
|
768
|
+
try {
|
|
769
|
+
let response;
|
|
770
|
+
if (selectedAccount.type.toLowerCase() === "enterprise") {
|
|
771
|
+
response = await request({
|
|
772
|
+
url: `/notify/v1/enterprise/rooms/${roomId}/change_pin_status/`,
|
|
773
|
+
method: "patch",
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
if (
|
|
777
|
+
selectedAccount.type.toLowerCase() === "instructor" &&
|
|
778
|
+
affiliateAccount
|
|
779
|
+
// &&
|
|
780
|
+
// affiliatesActive
|
|
781
|
+
) {
|
|
782
|
+
response = await request({
|
|
783
|
+
url: `/notify/v1/instructor/${affiliateAccount}/rooms/${roomId}/change_pin_status/`,
|
|
784
|
+
method: "patch",
|
|
785
|
+
});
|
|
786
|
+
} // incomplete
|
|
787
|
+
} catch (err) {
|
|
789
788
|
// Revert optimistic update on failure (optional, depends on desired UX)
|
|
790
789
|
// You might want to implement more specific error handling here
|
|
791
790
|
getMessageRoomsByCourses(null, true);
|
|
792
|
-
return;
|
|
793
791
|
}
|
|
792
|
+
|
|
794
793
|
// const isPinned = response.data.detail === "True";
|
|
795
794
|
// The optimistic update should ideally handle the UI change,
|
|
796
795
|
// so no further state update might be needed here based on the response.
|
|
@@ -809,7 +808,7 @@ const useMessageKit = (/*affiliatesActive*/) => {
|
|
|
809
808
|
useEffect(() => {
|
|
810
809
|
(async () => {
|
|
811
810
|
await getMessageRoomsByCourses();
|
|
812
|
-
await pinRoom("5be9b48281ac4c2885d3b719654ed59d");
|
|
811
|
+
// await pinRoom("5be9b48281ac4c2885d3b719654ed59d");
|
|
813
812
|
// Example: Fetch initial chat for a specific room if needed on load
|
|
814
813
|
// await getIndividualChats(null, "5be9b48281ac4c2885d3b719654ed59d");
|
|
815
814
|
// await readRoomMessages({
|