@selfcommunity/react-core 0.4.24-alpha.1 → 0.4.25-alpha.0
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.
|
@@ -29,7 +29,7 @@ function useSCSubscribedGroupsManager(user) {
|
|
|
29
29
|
const { cache, updateCache, emptyCache, data, setData, loading, setLoading, setUnLoading, isLoading } = (0, useSCCachingManager_1.default)();
|
|
30
30
|
const { features } = (0, SCPreferencesProvider_1.useSCPreferences)();
|
|
31
31
|
const authUserId = user ? user.id : null;
|
|
32
|
-
const
|
|
32
|
+
const groupsEnabled = (0, react_1.useMemo)(() => features && features.includes(types_1.SCFeatureName.GROUPING) && features.includes(types_1.SCFeatureName.TAGGING), [features]);
|
|
33
33
|
const notificationInvitedToJoinGroup = (0, react_1.useRef)(null);
|
|
34
34
|
const notificationRequestedToJoinGroup = (0, react_1.useRef)(null);
|
|
35
35
|
const notificationAcceptedToJoinGroup = (0, react_1.useRef)(null);
|
|
@@ -263,7 +263,7 @@ function useSCSubscribedGroupsManager(user) {
|
|
|
263
263
|
emptyCache();
|
|
264
264
|
}
|
|
265
265
|
}, [authUserId]);
|
|
266
|
-
if (
|
|
266
|
+
if (!groupsEnabled || !user) {
|
|
267
267
|
return { groups: data, loading, isLoading };
|
|
268
268
|
}
|
|
269
269
|
return { groups: data, loading, isLoading, subscribe, unsubscribe, subscriptionStatus, refresh, emptyCache };
|
|
@@ -26,7 +26,7 @@ export default function useSCSubscribedGroupsManager(user) {
|
|
|
26
26
|
const { cache, updateCache, emptyCache, data, setData, loading, setLoading, setUnLoading, isLoading } = useSCCachingManager();
|
|
27
27
|
const { features } = useSCPreferences();
|
|
28
28
|
const authUserId = user ? user.id : null;
|
|
29
|
-
const
|
|
29
|
+
const groupsEnabled = useMemo(() => features && features.includes(SCFeatureName.GROUPING) && features.includes(SCFeatureName.TAGGING), [features]);
|
|
30
30
|
const notificationInvitedToJoinGroup = useRef(null);
|
|
31
31
|
const notificationRequestedToJoinGroup = useRef(null);
|
|
32
32
|
const notificationAcceptedToJoinGroup = useRef(null);
|
|
@@ -260,7 +260,7 @@ export default function useSCSubscribedGroupsManager(user) {
|
|
|
260
260
|
emptyCache();
|
|
261
261
|
}
|
|
262
262
|
}, [authUserId]);
|
|
263
|
-
if (
|
|
263
|
+
if (!groupsEnabled || !user) {
|
|
264
264
|
return { groups: data, loading, isLoading };
|
|
265
265
|
}
|
|
266
266
|
return { groups: data, loading, isLoading, subscribe, unsubscribe, subscriptionStatus, refresh, emptyCache };
|