@selfcommunity/react-core 0.4.20-alpha.0 → 0.4.20-alpha.2
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.
|
@@ -55,7 +55,6 @@ function useSCSubscribedGroupsManager(user) {
|
|
|
55
55
|
* @param dataMsg
|
|
56
56
|
*/
|
|
57
57
|
const notificationSubscriber = (msg, dataMsg) => {
|
|
58
|
-
console.log(msg, dataMsg, 'subscriber');
|
|
59
58
|
if (dataMsg.data.group !== undefined) {
|
|
60
59
|
let _status;
|
|
61
60
|
switch (Notification_1.SCNotificationMapping[dataMsg.data.activity_type]) {
|
|
@@ -226,7 +225,7 @@ function useSCSubscribedGroupsManager(user) {
|
|
|
226
225
|
*/
|
|
227
226
|
const getCurrentGroupCacheStatus = (0, react_1.useMemo)(() => (group) => {
|
|
228
227
|
const d = data.filter((k) => parseInt(Object.keys(k)[0]) === group.id);
|
|
229
|
-
return d.length ? d[0][group.id] : null;
|
|
228
|
+
return d.length ? d[0][group.id] : !data.length ? group.subscription_status : null;
|
|
230
229
|
}, [data]);
|
|
231
230
|
/**
|
|
232
231
|
* Bypass remote check if the group is subscribed
|
|
@@ -52,7 +52,6 @@ export default function useSCSubscribedGroupsManager(user) {
|
|
|
52
52
|
* @param dataMsg
|
|
53
53
|
*/
|
|
54
54
|
const notificationSubscriber = (msg, dataMsg) => {
|
|
55
|
-
console.log(msg, dataMsg, 'subscriber');
|
|
56
55
|
if (dataMsg.data.group !== undefined) {
|
|
57
56
|
let _status;
|
|
58
57
|
switch (SCNotificationMapping[dataMsg.data.activity_type]) {
|
|
@@ -223,7 +222,7 @@ export default function useSCSubscribedGroupsManager(user) {
|
|
|
223
222
|
*/
|
|
224
223
|
const getCurrentGroupCacheStatus = useMemo(() => (group) => {
|
|
225
224
|
const d = data.filter((k) => parseInt(Object.keys(k)[0]) === group.id);
|
|
226
|
-
return d.length ? d[0][group.id] : null;
|
|
225
|
+
return d.length ? d[0][group.id] : !data.length ? group.subscription_status : null;
|
|
227
226
|
}, [data]);
|
|
228
227
|
/**
|
|
229
228
|
* Bypass remote check if the group is subscribed
|