@selfcommunity/react-core 0.4.0-alpha.11 → 0.4.0-alpha.111
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/lib/cjs/components/provider/SCAlertMessagesProvider/index.d.ts +0 -1
- package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js +2 -25
- package/lib/cjs/components/provider/SCContextProvider/index.d.ts +0 -1
- package/lib/cjs/components/provider/SCContextProvider/index.js +3 -29
- package/lib/cjs/components/provider/SCLocaleProvider/index.d.ts +0 -1
- package/lib/cjs/components/provider/SCLocaleProvider/index.js +2 -25
- package/lib/cjs/components/provider/SCNotificationProvider/index.d.ts +0 -1
- package/lib/cjs/components/provider/SCNotificationProvider/index.js +7 -31
- package/lib/cjs/components/provider/SCPreferencesProvider/index.d.ts +0 -1
- package/lib/cjs/components/provider/SCPreferencesProvider/index.js +2 -25
- package/lib/cjs/components/provider/SCRoutingProvider/index.d.ts +0 -1
- package/lib/cjs/components/provider/SCRoutingProvider/index.js +4 -27
- package/lib/cjs/components/provider/SCThemeProvider/index.d.ts +0 -1
- package/lib/cjs/components/provider/SCThemeProvider/index.js +6 -32
- package/lib/cjs/components/provider/SCUserProvider/index.d.ts +0 -1
- package/lib/cjs/components/provider/SCUserProvider/index.js +32 -49
- package/lib/cjs/components/provider/SCVoteProvider/index.d.ts +37 -0
- package/lib/cjs/components/provider/SCVoteProvider/index.js +112 -0
- package/lib/cjs/components/router/index.d.ts +0 -1
- package/lib/cjs/components/router/index.js +5 -39
- package/lib/cjs/constants/Actions.d.ts +0 -1
- package/lib/cjs/constants/Actions.js +0 -1
- package/lib/cjs/constants/Cache.d.ts +23 -15
- package/lib/cjs/constants/Cache.js +28 -17
- package/lib/cjs/constants/ContextProviders.d.ts +0 -1
- package/lib/cjs/constants/ContextProviders.js +12 -13
- package/lib/cjs/constants/Device.d.ts +22 -1
- package/lib/cjs/constants/Device.js +27 -2
- package/lib/cjs/constants/Errors.d.ts +0 -1
- package/lib/cjs/constants/Errors.js +0 -1
- package/lib/cjs/constants/Features.d.ts +0 -43
- package/lib/cjs/constants/Features.js +1 -44
- package/lib/cjs/constants/Locale.d.ts +0 -1
- package/lib/cjs/constants/Locale.js +0 -1
- package/lib/cjs/constants/Notification.d.ts +0 -1
- package/lib/cjs/constants/Notification.js +0 -1
- package/lib/cjs/constants/Notifications.d.ts +3 -1
- package/lib/cjs/constants/Notifications.js +7 -2
- package/lib/cjs/constants/Preferences.d.ts +13 -2
- package/lib/cjs/constants/Preferences.js +21 -5
- package/lib/cjs/constants/Routes.d.ts +3 -1
- package/lib/cjs/constants/Routes.js +8 -3
- package/lib/cjs/constants/Session.d.ts +0 -1
- package/lib/cjs/constants/Session.js +0 -1
- package/lib/cjs/constants/Theme.d.ts +0 -1
- package/lib/cjs/constants/Theme.js +0 -1
- package/lib/cjs/constants/Vote.d.ts +6 -0
- package/lib/cjs/constants/Vote.js +9 -0
- package/lib/cjs/constants/WebSocket.d.ts +0 -1
- package/lib/cjs/constants/WebSocket.js +0 -1
- package/lib/cjs/hooks/useSCAuth.d.ts +0 -1
- package/lib/cjs/hooks/useSCAuth.js +34 -51
- package/lib/cjs/hooks/useSCBlockedUsersManager.d.ts +30 -0
- package/lib/cjs/hooks/useSCBlockedUsersManager.js +108 -0
- package/lib/cjs/hooks/useSCCachingManager.d.ts +5 -5
- package/lib/cjs/hooks/useSCCachingManager.js +21 -6
- package/lib/cjs/hooks/useSCConnectionsManager.d.ts +8 -5
- package/lib/cjs/hooks/useSCConnectionsManager.js +141 -91
- package/lib/cjs/hooks/useSCFetchAddressingTagList.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchAddressingTagList.js +2 -26
- package/lib/cjs/hooks/useSCFetchBroadcastMessages.d.ts +30 -0
- package/lib/cjs/hooks/useSCFetchBroadcastMessages.js +91 -0
- package/lib/cjs/hooks/useSCFetchCategories.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchCategories.js +2 -11
- package/lib/cjs/hooks/useSCFetchCategory.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchCategory.js +13 -12
- package/lib/cjs/hooks/useSCFetchCommentObject.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchCommentObject.js +1 -2
- package/lib/cjs/hooks/useSCFetchCommentObjects.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchCommentObjects.js +2 -5
- package/lib/cjs/hooks/useSCFetchContributors.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchContributors.js +2 -5
- package/lib/cjs/hooks/useSCFetchCustomAdv.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchCustomAdv.js +2 -5
- package/lib/cjs/hooks/useSCFetchFeed.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchFeed.js +3 -6
- package/lib/cjs/hooks/useSCFetchFeedObject.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchFeedObject.js +0 -1
- package/lib/cjs/hooks/useSCFetchIncubator.d.ts +4 -2
- package/lib/cjs/hooks/useSCFetchIncubator.js +28 -8
- package/lib/cjs/hooks/useSCFetchPrivateMessageSnippets.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchPrivateMessageSnippets.js +16 -26
- package/lib/cjs/hooks/useSCFetchReactions.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchReactions.js +3 -50
- package/lib/cjs/hooks/useSCFetchTag.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchTag.js +0 -1
- package/lib/cjs/hooks/useSCFetchUser.d.ts +2 -1
- package/lib/cjs/hooks/useSCFetchUser.js +33 -8
- package/lib/cjs/hooks/useSCFetchUserBlockedBy.d.ts +17 -0
- package/lib/cjs/hooks/useSCFetchUserBlockedBy.js +83 -0
- package/lib/cjs/hooks/useSCFetchUserProviders.d.ts +0 -1
- package/lib/cjs/hooks/useSCFetchUserProviders.js +0 -1
- package/lib/cjs/hooks/useSCFetchVote.d.ts +2 -3
- package/lib/cjs/hooks/useSCFetchVote.js +58 -77
- package/lib/cjs/hooks/useSCFollowedCategoriesManager.d.ts +4 -5
- package/lib/cjs/hooks/useSCFollowedCategoriesManager.js +26 -17
- package/lib/cjs/hooks/useSCFollowedManager.d.ts +4 -5
- package/lib/cjs/hooks/useSCFollowedManager.js +38 -24
- package/lib/cjs/hooks/useSCFollowersManager.d.ts +4 -5
- package/lib/cjs/hooks/useSCFollowersManager.js +7 -10
- package/lib/cjs/hooks/useSCMediaClick.d.ts +0 -1
- package/lib/cjs/hooks/useSCMediaClick.js +0 -1
- package/lib/cjs/hooks/useSCMobileNativePushMessaging.d.ts +19 -0
- package/lib/cjs/hooks/useSCMobileNativePushMessaging.js +143 -0
- package/lib/cjs/hooks/useSCSettingsManager.d.ts +0 -1
- package/lib/cjs/hooks/useSCSettingsManager.js +0 -1
- package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.d.ts +12 -3
- package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js +39 -32
- package/lib/cjs/hooks/useSCUserIsBlocked.d.ts +18 -0
- package/lib/cjs/hooks/useSCUserIsBlocked.js +33 -0
- package/lib/cjs/hooks/useSCWebPushMessaging.d.ts +12 -2
- package/lib/cjs/hooks/useSCWebPushMessaging.js +188 -106
- package/lib/cjs/hooks/useSCWebSocket.d.ts +1 -2
- package/lib/cjs/hooks/useSCWebSocket.js +3 -6
- package/lib/cjs/index.d.ts +4 -2
- package/lib/cjs/index.js +41 -61
- package/lib/cjs/themes/theme.d.ts +0 -1
- package/lib/cjs/themes/theme.js +4 -80
- package/lib/cjs/types/context.d.ts +96 -6
- package/lib/cjs/types/context.js +0 -1
- package/lib/cjs/types/index.d.ts +2 -3
- package/lib/cjs/types/index.js +0 -1
- package/lib/cjs/types/theme.d.ts +1 -2
- package/lib/cjs/types/theme.js +0 -1
- package/lib/cjs/utils/errors.d.ts +5 -6
- package/lib/cjs/utils/errors.js +13 -34
- package/lib/cjs/utils/hooks/index.d.ts +0 -1
- package/lib/cjs/utils/hooks/index.js +6 -9
- package/lib/cjs/utils/hooks/useEffectOnce.d.ts +0 -1
- package/lib/cjs/utils/hooks/useEffectOnce.js +0 -1
- package/lib/cjs/utils/hooks/useIsComponentMountedRef.d.ts +0 -1
- package/lib/cjs/utils/hooks/useIsComponentMountedRef.js +0 -1
- package/lib/cjs/utils/hooks/useIsomorphicLayoutEffect.d.ts +0 -1
- package/lib/cjs/utils/hooks/useIsomorphicLayoutEffect.js +0 -1
- package/lib/cjs/utils/hooks/useNoInitialEffect.d.ts +0 -1
- package/lib/cjs/utils/hooks/useNoInitialEffect.js +0 -1
- package/lib/cjs/utils/hooks/usePreviousValue.d.ts +0 -1
- package/lib/cjs/utils/hooks/usePreviousValue.js +0 -1
- package/lib/cjs/utils/locale.d.ts +0 -1
- package/lib/cjs/utils/locale.js +2 -5
- package/lib/cjs/utils/notification.d.ts +8 -0
- package/lib/cjs/utils/notification.js +20 -0
- package/lib/cjs/utils/pagination.d.ts +0 -1
- package/lib/cjs/utils/pagination.js +0 -1
- package/lib/cjs/utils/user.d.ts +0 -1
- package/lib/cjs/utils/user.js +0 -1
- package/lib/cjs/utils/validator.d.ts +49 -3
- package/lib/cjs/utils/validator.js +144 -41
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.d.ts +0 -1
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.js +0 -1
- package/lib/esm/components/provider/SCContextProvider/index.d.ts +0 -1
- package/lib/esm/components/provider/SCContextProvider/index.js +0 -1
- package/lib/esm/components/provider/SCLocaleProvider/index.d.ts +0 -1
- package/lib/esm/components/provider/SCLocaleProvider/index.js +0 -1
- package/lib/esm/components/provider/SCNotificationProvider/index.d.ts +0 -1
- package/lib/esm/components/provider/SCNotificationProvider/index.js +3 -2
- package/lib/esm/components/provider/SCPreferencesProvider/index.d.ts +0 -1
- package/lib/esm/components/provider/SCPreferencesProvider/index.js +0 -1
- package/lib/esm/components/provider/SCRoutingProvider/index.d.ts +0 -1
- package/lib/esm/components/provider/SCRoutingProvider/index.js +1 -2
- package/lib/esm/components/provider/SCThemeProvider/index.d.ts +0 -1
- package/lib/esm/components/provider/SCThemeProvider/index.js +1 -2
- package/lib/esm/components/provider/SCUserProvider/index.d.ts +0 -1
- package/lib/esm/components/provider/SCUserProvider/index.js +22 -14
- package/lib/esm/components/provider/SCVoteProvider/index.d.ts +37 -0
- package/lib/esm/components/provider/SCVoteProvider/index.js +106 -0
- package/lib/esm/components/router/index.d.ts +0 -1
- package/lib/esm/components/router/index.js +2 -13
- package/lib/esm/constants/Actions.d.ts +0 -1
- package/lib/esm/constants/Actions.js +0 -1
- package/lib/esm/constants/Cache.d.ts +23 -15
- package/lib/esm/constants/Cache.js +23 -15
- package/lib/esm/constants/ContextProviders.d.ts +0 -1
- package/lib/esm/constants/ContextProviders.js +4 -3
- package/lib/esm/constants/Device.d.ts +22 -1
- package/lib/esm/constants/Device.js +26 -1
- package/lib/esm/constants/Errors.d.ts +0 -1
- package/lib/esm/constants/Errors.js +0 -1
- package/lib/esm/constants/Features.d.ts +0 -43
- package/lib/esm/constants/Features.js +0 -43
- package/lib/esm/constants/Locale.d.ts +0 -1
- package/lib/esm/constants/Locale.js +0 -1
- package/lib/esm/constants/Notification.d.ts +0 -1
- package/lib/esm/constants/Notification.js +0 -1
- package/lib/esm/constants/Notifications.d.ts +3 -1
- package/lib/esm/constants/Notifications.js +6 -1
- package/lib/esm/constants/Preferences.d.ts +13 -2
- package/lib/esm/constants/Preferences.js +18 -3
- package/lib/esm/constants/Routes.d.ts +3 -1
- package/lib/esm/constants/Routes.js +7 -2
- package/lib/esm/constants/Session.d.ts +0 -1
- package/lib/esm/constants/Session.js +0 -1
- package/lib/esm/constants/Theme.d.ts +0 -1
- package/lib/esm/constants/Theme.js +0 -1
- package/lib/esm/constants/Vote.d.ts +6 -0
- package/lib/esm/constants/Vote.js +6 -0
- package/lib/esm/constants/WebSocket.d.ts +0 -1
- package/lib/esm/constants/WebSocket.js +0 -1
- package/lib/esm/hooks/useSCAuth.d.ts +0 -1
- package/lib/esm/hooks/useSCAuth.js +31 -22
- package/lib/esm/hooks/useSCBlockedUsersManager.d.ts +30 -0
- package/lib/esm/hooks/useSCBlockedUsersManager.js +105 -0
- package/lib/esm/hooks/useSCCachingManager.d.ts +5 -5
- package/lib/esm/hooks/useSCCachingManager.js +21 -6
- package/lib/esm/hooks/useSCConnectionsManager.d.ts +8 -5
- package/lib/esm/hooks/useSCConnectionsManager.js +138 -86
- package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchAddressingTagList.js +3 -4
- package/lib/esm/hooks/useSCFetchBroadcastMessages.d.ts +30 -0
- package/lib/esm/hooks/useSCFetchBroadcastMessages.js +89 -0
- package/lib/esm/hooks/useSCFetchCategories.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchCategories.js +1 -10
- package/lib/esm/hooks/useSCFetchCategory.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchCategory.js +15 -14
- package/lib/esm/hooks/useSCFetchCommentObject.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchCommentObject.js +1 -2
- package/lib/esm/hooks/useSCFetchCommentObjects.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchCommentObjects.js +0 -1
- package/lib/esm/hooks/useSCFetchContributors.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchContributors.js +0 -1
- package/lib/esm/hooks/useSCFetchCustomAdv.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchCustomAdv.js +0 -1
- package/lib/esm/hooks/useSCFetchFeed.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchFeed.js +1 -2
- package/lib/esm/hooks/useSCFetchFeedObject.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchFeedObject.js +0 -1
- package/lib/esm/hooks/useSCFetchIncubator.d.ts +4 -2
- package/lib/esm/hooks/useSCFetchIncubator.js +29 -9
- package/lib/esm/hooks/useSCFetchPrivateMessageSnippets.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchPrivateMessageSnippets.js +15 -25
- package/lib/esm/hooks/useSCFetchReactions.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchReactions.js +5 -29
- package/lib/esm/hooks/useSCFetchTag.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchTag.js +0 -1
- package/lib/esm/hooks/useSCFetchUser.d.ts +2 -1
- package/lib/esm/hooks/useSCFetchUser.js +34 -9
- package/lib/esm/hooks/useSCFetchUserBlockedBy.d.ts +17 -0
- package/lib/esm/hooks/useSCFetchUserBlockedBy.js +80 -0
- package/lib/esm/hooks/useSCFetchUserProviders.d.ts +0 -1
- package/lib/esm/hooks/useSCFetchUserProviders.js +0 -1
- package/lib/esm/hooks/useSCFetchVote.d.ts +2 -3
- package/lib/esm/hooks/useSCFetchVote.js +56 -73
- package/lib/esm/hooks/useSCFollowedCategoriesManager.d.ts +4 -5
- package/lib/esm/hooks/useSCFollowedCategoriesManager.js +25 -14
- package/lib/esm/hooks/useSCFollowedManager.d.ts +4 -5
- package/lib/esm/hooks/useSCFollowedManager.js +37 -21
- package/lib/esm/hooks/useSCFollowersManager.d.ts +4 -5
- package/lib/esm/hooks/useSCFollowersManager.js +4 -5
- package/lib/esm/hooks/useSCMediaClick.d.ts +0 -1
- package/lib/esm/hooks/useSCMediaClick.js +0 -1
- package/lib/esm/hooks/useSCMobileNativePushMessaging.d.ts +19 -0
- package/lib/esm/hooks/useSCMobileNativePushMessaging.js +140 -0
- package/lib/esm/hooks/useSCSettingsManager.d.ts +0 -1
- package/lib/esm/hooks/useSCSettingsManager.js +0 -1
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.d.ts +12 -3
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js +38 -29
- package/lib/esm/hooks/useSCUserIsBlocked.d.ts +18 -0
- package/lib/esm/hooks/useSCUserIsBlocked.js +29 -0
- package/lib/esm/hooks/useSCWebPushMessaging.d.ts +12 -2
- package/lib/esm/hooks/useSCWebPushMessaging.js +185 -82
- package/lib/esm/hooks/useSCWebSocket.d.ts +1 -2
- package/lib/esm/hooks/useSCWebSocket.js +1 -2
- package/lib/esm/index.d.ts +4 -2
- package/lib/esm/index.js +4 -2
- package/lib/esm/themes/theme.d.ts +0 -1
- package/lib/esm/themes/theme.js +1 -75
- package/lib/esm/types/context.d.ts +96 -6
- package/lib/esm/types/context.js +0 -1
- package/lib/esm/types/index.d.ts +2 -3
- package/lib/esm/types/index.js +0 -1
- package/lib/esm/types/theme.d.ts +1 -2
- package/lib/esm/types/theme.js +0 -1
- package/lib/esm/utils/errors.d.ts +5 -6
- package/lib/esm/utils/errors.js +10 -8
- package/lib/esm/utils/hooks/index.d.ts +0 -1
- package/lib/esm/utils/hooks/index.js +0 -1
- package/lib/esm/utils/hooks/useEffectOnce.d.ts +0 -1
- package/lib/esm/utils/hooks/useEffectOnce.js +0 -1
- package/lib/esm/utils/hooks/useIsComponentMountedRef.d.ts +0 -1
- package/lib/esm/utils/hooks/useIsComponentMountedRef.js +0 -1
- package/lib/esm/utils/hooks/useIsomorphicLayoutEffect.d.ts +0 -1
- package/lib/esm/utils/hooks/useIsomorphicLayoutEffect.js +0 -1
- package/lib/esm/utils/hooks/useNoInitialEffect.d.ts +0 -1
- package/lib/esm/utils/hooks/useNoInitialEffect.js +0 -1
- package/lib/esm/utils/hooks/usePreviousValue.d.ts +0 -1
- package/lib/esm/utils/hooks/usePreviousValue.js +0 -1
- package/lib/esm/utils/locale.d.ts +0 -1
- package/lib/esm/utils/locale.js +0 -1
- package/lib/esm/utils/notification.d.ts +8 -0
- package/lib/esm/utils/notification.js +15 -0
- package/lib/esm/utils/pagination.d.ts +0 -1
- package/lib/esm/utils/pagination.js +0 -1
- package/lib/esm/utils/user.d.ts +0 -1
- package/lib/esm/utils/user.js +0 -1
- package/lib/esm/utils/validator.d.ts +49 -3
- package/lib/esm/utils/validator.js +129 -8
- package/lib/umd/251.js +2 -0
- package/lib/umd/251.js.LICENSE.txt +1 -0
- package/lib/umd/react-core.js +1 -1
- package/lib/umd/react-core.js.LICENSE.txt +1 -1
- package/package.json +25 -24
- package/lib/cjs/components/provider/SCAlertMessagesProvider/index.d.ts.map +0 -1
- package/lib/cjs/components/provider/SCAlertMessagesProvider/index.js.map +0 -1
- package/lib/cjs/components/provider/SCContextProvider/index.d.ts.map +0 -1
- package/lib/cjs/components/provider/SCContextProvider/index.js.map +0 -1
- package/lib/cjs/components/provider/SCLocaleProvider/index.d.ts.map +0 -1
- package/lib/cjs/components/provider/SCLocaleProvider/index.js.map +0 -1
- package/lib/cjs/components/provider/SCNotificationProvider/index.d.ts.map +0 -1
- package/lib/cjs/components/provider/SCNotificationProvider/index.js.map +0 -1
- package/lib/cjs/components/provider/SCPreferencesProvider/index.d.ts.map +0 -1
- package/lib/cjs/components/provider/SCPreferencesProvider/index.js.map +0 -1
- package/lib/cjs/components/provider/SCRoutingProvider/index.d.ts.map +0 -1
- package/lib/cjs/components/provider/SCRoutingProvider/index.js.map +0 -1
- package/lib/cjs/components/provider/SCThemeProvider/index.d.ts.map +0 -1
- package/lib/cjs/components/provider/SCThemeProvider/index.js.map +0 -1
- package/lib/cjs/components/provider/SCUserProvider/index.d.ts.map +0 -1
- package/lib/cjs/components/provider/SCUserProvider/index.js.map +0 -1
- package/lib/cjs/components/router/index.d.ts.map +0 -1
- package/lib/cjs/components/router/index.js.map +0 -1
- package/lib/cjs/constants/Actions.d.ts.map +0 -1
- package/lib/cjs/constants/Actions.js.map +0 -1
- package/lib/cjs/constants/Cache.d.ts.map +0 -1
- package/lib/cjs/constants/Cache.js.map +0 -1
- package/lib/cjs/constants/ContextProviders.d.ts.map +0 -1
- package/lib/cjs/constants/ContextProviders.js.map +0 -1
- package/lib/cjs/constants/Device.d.ts.map +0 -1
- package/lib/cjs/constants/Device.js.map +0 -1
- package/lib/cjs/constants/Errors.d.ts.map +0 -1
- package/lib/cjs/constants/Errors.js.map +0 -1
- package/lib/cjs/constants/Features.d.ts.map +0 -1
- package/lib/cjs/constants/Features.js.map +0 -1
- package/lib/cjs/constants/Locale.d.ts.map +0 -1
- package/lib/cjs/constants/Locale.js.map +0 -1
- package/lib/cjs/constants/Notification.d.ts.map +0 -1
- package/lib/cjs/constants/Notification.js.map +0 -1
- package/lib/cjs/constants/Notifications.d.ts.map +0 -1
- package/lib/cjs/constants/Notifications.js.map +0 -1
- package/lib/cjs/constants/Preferences.d.ts.map +0 -1
- package/lib/cjs/constants/Preferences.js.map +0 -1
- package/lib/cjs/constants/Routes.d.ts.map +0 -1
- package/lib/cjs/constants/Routes.js.map +0 -1
- package/lib/cjs/constants/Session.d.ts.map +0 -1
- package/lib/cjs/constants/Session.js.map +0 -1
- package/lib/cjs/constants/Theme.d.ts.map +0 -1
- package/lib/cjs/constants/Theme.js.map +0 -1
- package/lib/cjs/constants/WebSocket.d.ts.map +0 -1
- package/lib/cjs/constants/WebSocket.js.map +0 -1
- package/lib/cjs/hooks/useSCAuth.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCAuth.js.map +0 -1
- package/lib/cjs/hooks/useSCCachingManager.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCCachingManager.js.map +0 -1
- package/lib/cjs/hooks/useSCConnectionsManager.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCConnectionsManager.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchAddressingTagList.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchAddressingTagList.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchCategories.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchCategories.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchCategory.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchCategory.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchCommentObject.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchCommentObject.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchCommentObjects.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchCommentObjects.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchContributors.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchContributors.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchCustomAdv.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchCustomAdv.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchFeed.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchFeed.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchFeedObject.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchFeedObject.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchIncubator.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchIncubator.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchPrivateMessageSnippets.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchPrivateMessageSnippets.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchReactions.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchReactions.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchTag.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchTag.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchUser.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchUser.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchUserProviders.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchUserProviders.js.map +0 -1
- package/lib/cjs/hooks/useSCFetchVote.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFetchVote.js.map +0 -1
- package/lib/cjs/hooks/useSCFollowedCategoriesManager.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFollowedCategoriesManager.js.map +0 -1
- package/lib/cjs/hooks/useSCFollowedManager.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFollowedManager.js.map +0 -1
- package/lib/cjs/hooks/useSCFollowersManager.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCFollowersManager.js.map +0 -1
- package/lib/cjs/hooks/useSCMediaClick.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCMediaClick.js.map +0 -1
- package/lib/cjs/hooks/useSCSettingsManager.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCSettingsManager.js.map +0 -1
- package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCSubscribedIncubatorsManager.js.map +0 -1
- package/lib/cjs/hooks/useSCWebPushMessaging.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCWebPushMessaging.js.map +0 -1
- package/lib/cjs/hooks/useSCWebSocket.d.ts.map +0 -1
- package/lib/cjs/hooks/useSCWebSocket.js.map +0 -1
- package/lib/cjs/index.d.ts.map +0 -1
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/themes/theme.d.ts.map +0 -1
- package/lib/cjs/themes/theme.js.map +0 -1
- package/lib/cjs/types/context.d.ts.map +0 -1
- package/lib/cjs/types/context.js.map +0 -1
- package/lib/cjs/types/index.d.ts.map +0 -1
- package/lib/cjs/types/index.js.map +0 -1
- package/lib/cjs/types/theme.d.ts.map +0 -1
- package/lib/cjs/types/theme.js.map +0 -1
- package/lib/cjs/utils/errors.d.ts.map +0 -1
- package/lib/cjs/utils/errors.js.map +0 -1
- package/lib/cjs/utils/hooks/index.d.ts.map +0 -1
- package/lib/cjs/utils/hooks/index.js.map +0 -1
- package/lib/cjs/utils/hooks/useEffectOnce.d.ts.map +0 -1
- package/lib/cjs/utils/hooks/useEffectOnce.js.map +0 -1
- package/lib/cjs/utils/hooks/useIsComponentMountedRef.d.ts.map +0 -1
- package/lib/cjs/utils/hooks/useIsComponentMountedRef.js.map +0 -1
- package/lib/cjs/utils/hooks/useIsomorphicLayoutEffect.d.ts.map +0 -1
- package/lib/cjs/utils/hooks/useIsomorphicLayoutEffect.js.map +0 -1
- package/lib/cjs/utils/hooks/useNoInitialEffect.d.ts.map +0 -1
- package/lib/cjs/utils/hooks/useNoInitialEffect.js.map +0 -1
- package/lib/cjs/utils/hooks/usePreviousValue.d.ts.map +0 -1
- package/lib/cjs/utils/hooks/usePreviousValue.js.map +0 -1
- package/lib/cjs/utils/locale.d.ts.map +0 -1
- package/lib/cjs/utils/locale.js.map +0 -1
- package/lib/cjs/utils/pagination.d.ts.map +0 -1
- package/lib/cjs/utils/pagination.js.map +0 -1
- package/lib/cjs/utils/user.d.ts.map +0 -1
- package/lib/cjs/utils/user.js.map +0 -1
- package/lib/cjs/utils/validator.d.ts.map +0 -1
- package/lib/cjs/utils/validator.js.map +0 -1
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.d.ts.map +0 -1
- package/lib/esm/components/provider/SCAlertMessagesProvider/index.js.map +0 -1
- package/lib/esm/components/provider/SCContextProvider/index.d.ts.map +0 -1
- package/lib/esm/components/provider/SCContextProvider/index.js.map +0 -1
- package/lib/esm/components/provider/SCLocaleProvider/index.d.ts.map +0 -1
- package/lib/esm/components/provider/SCLocaleProvider/index.js.map +0 -1
- package/lib/esm/components/provider/SCNotificationProvider/index.d.ts.map +0 -1
- package/lib/esm/components/provider/SCNotificationProvider/index.js.map +0 -1
- package/lib/esm/components/provider/SCPreferencesProvider/index.d.ts.map +0 -1
- package/lib/esm/components/provider/SCPreferencesProvider/index.js.map +0 -1
- package/lib/esm/components/provider/SCRoutingProvider/index.d.ts.map +0 -1
- package/lib/esm/components/provider/SCRoutingProvider/index.js.map +0 -1
- package/lib/esm/components/provider/SCThemeProvider/index.d.ts.map +0 -1
- package/lib/esm/components/provider/SCThemeProvider/index.js.map +0 -1
- package/lib/esm/components/provider/SCUserProvider/index.d.ts.map +0 -1
- package/lib/esm/components/provider/SCUserProvider/index.js.map +0 -1
- package/lib/esm/components/router/index.d.ts.map +0 -1
- package/lib/esm/components/router/index.js.map +0 -1
- package/lib/esm/constants/Actions.d.ts.map +0 -1
- package/lib/esm/constants/Actions.js.map +0 -1
- package/lib/esm/constants/Cache.d.ts.map +0 -1
- package/lib/esm/constants/Cache.js.map +0 -1
- package/lib/esm/constants/ContextProviders.d.ts.map +0 -1
- package/lib/esm/constants/ContextProviders.js.map +0 -1
- package/lib/esm/constants/Device.d.ts.map +0 -1
- package/lib/esm/constants/Device.js.map +0 -1
- package/lib/esm/constants/Errors.d.ts.map +0 -1
- package/lib/esm/constants/Errors.js.map +0 -1
- package/lib/esm/constants/Features.d.ts.map +0 -1
- package/lib/esm/constants/Features.js.map +0 -1
- package/lib/esm/constants/Locale.d.ts.map +0 -1
- package/lib/esm/constants/Locale.js.map +0 -1
- package/lib/esm/constants/Notification.d.ts.map +0 -1
- package/lib/esm/constants/Notification.js.map +0 -1
- package/lib/esm/constants/Notifications.d.ts.map +0 -1
- package/lib/esm/constants/Notifications.js.map +0 -1
- package/lib/esm/constants/Preferences.d.ts.map +0 -1
- package/lib/esm/constants/Preferences.js.map +0 -1
- package/lib/esm/constants/Routes.d.ts.map +0 -1
- package/lib/esm/constants/Routes.js.map +0 -1
- package/lib/esm/constants/Session.d.ts.map +0 -1
- package/lib/esm/constants/Session.js.map +0 -1
- package/lib/esm/constants/Theme.d.ts.map +0 -1
- package/lib/esm/constants/Theme.js.map +0 -1
- package/lib/esm/constants/WebSocket.d.ts.map +0 -1
- package/lib/esm/constants/WebSocket.js.map +0 -1
- package/lib/esm/hooks/useSCAuth.d.ts.map +0 -1
- package/lib/esm/hooks/useSCAuth.js.map +0 -1
- package/lib/esm/hooks/useSCCachingManager.d.ts.map +0 -1
- package/lib/esm/hooks/useSCCachingManager.js.map +0 -1
- package/lib/esm/hooks/useSCConnectionsManager.d.ts.map +0 -1
- package/lib/esm/hooks/useSCConnectionsManager.js.map +0 -1
- package/lib/esm/hooks/useSCFetchAddressingTagList.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchAddressingTagList.js.map +0 -1
- package/lib/esm/hooks/useSCFetchCategories.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchCategories.js.map +0 -1
- package/lib/esm/hooks/useSCFetchCategory.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchCategory.js.map +0 -1
- package/lib/esm/hooks/useSCFetchCommentObject.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchCommentObject.js.map +0 -1
- package/lib/esm/hooks/useSCFetchCommentObjects.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchCommentObjects.js.map +0 -1
- package/lib/esm/hooks/useSCFetchContributors.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchContributors.js.map +0 -1
- package/lib/esm/hooks/useSCFetchCustomAdv.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchCustomAdv.js.map +0 -1
- package/lib/esm/hooks/useSCFetchFeed.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchFeed.js.map +0 -1
- package/lib/esm/hooks/useSCFetchFeedObject.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchFeedObject.js.map +0 -1
- package/lib/esm/hooks/useSCFetchIncubator.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchIncubator.js.map +0 -1
- package/lib/esm/hooks/useSCFetchPrivateMessageSnippets.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchPrivateMessageSnippets.js.map +0 -1
- package/lib/esm/hooks/useSCFetchReactions.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchReactions.js.map +0 -1
- package/lib/esm/hooks/useSCFetchTag.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchTag.js.map +0 -1
- package/lib/esm/hooks/useSCFetchUser.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchUser.js.map +0 -1
- package/lib/esm/hooks/useSCFetchUserProviders.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchUserProviders.js.map +0 -1
- package/lib/esm/hooks/useSCFetchVote.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFetchVote.js.map +0 -1
- package/lib/esm/hooks/useSCFollowedCategoriesManager.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFollowedCategoriesManager.js.map +0 -1
- package/lib/esm/hooks/useSCFollowedManager.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFollowedManager.js.map +0 -1
- package/lib/esm/hooks/useSCFollowersManager.d.ts.map +0 -1
- package/lib/esm/hooks/useSCFollowersManager.js.map +0 -1
- package/lib/esm/hooks/useSCMediaClick.d.ts.map +0 -1
- package/lib/esm/hooks/useSCMediaClick.js.map +0 -1
- package/lib/esm/hooks/useSCSettingsManager.d.ts.map +0 -1
- package/lib/esm/hooks/useSCSettingsManager.js.map +0 -1
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.d.ts.map +0 -1
- package/lib/esm/hooks/useSCSubscribedIncubatorsManager.js.map +0 -1
- package/lib/esm/hooks/useSCWebPushMessaging.d.ts.map +0 -1
- package/lib/esm/hooks/useSCWebPushMessaging.js.map +0 -1
- package/lib/esm/hooks/useSCWebSocket.d.ts.map +0 -1
- package/lib/esm/hooks/useSCWebSocket.js.map +0 -1
- package/lib/esm/index.d.ts.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/themes/theme.d.ts.map +0 -1
- package/lib/esm/themes/theme.js.map +0 -1
- package/lib/esm/types/context.d.ts.map +0 -1
- package/lib/esm/types/context.js.map +0 -1
- package/lib/esm/types/index.d.ts.map +0 -1
- package/lib/esm/types/index.js.map +0 -1
- package/lib/esm/types/theme.d.ts.map +0 -1
- package/lib/esm/types/theme.js.map +0 -1
- package/lib/esm/utils/errors.d.ts.map +0 -1
- package/lib/esm/utils/errors.js.map +0 -1
- package/lib/esm/utils/hooks/index.d.ts.map +0 -1
- package/lib/esm/utils/hooks/index.js.map +0 -1
- package/lib/esm/utils/hooks/useEffectOnce.d.ts.map +0 -1
- package/lib/esm/utils/hooks/useEffectOnce.js.map +0 -1
- package/lib/esm/utils/hooks/useIsComponentMountedRef.d.ts.map +0 -1
- package/lib/esm/utils/hooks/useIsComponentMountedRef.js.map +0 -1
- package/lib/esm/utils/hooks/useIsomorphicLayoutEffect.d.ts.map +0 -1
- package/lib/esm/utils/hooks/useIsomorphicLayoutEffect.js.map +0 -1
- package/lib/esm/utils/hooks/useNoInitialEffect.d.ts.map +0 -1
- package/lib/esm/utils/hooks/useNoInitialEffect.js.map +0 -1
- package/lib/esm/utils/hooks/usePreviousValue.d.ts.map +0 -1
- package/lib/esm/utils/hooks/usePreviousValue.js.map +0 -1
- package/lib/esm/utils/locale.d.ts.map +0 -1
- package/lib/esm/utils/locale.js.map +0 -1
- package/lib/esm/utils/pagination.d.ts.map +0 -1
- package/lib/esm/utils/pagination.js.map +0 -1
- package/lib/esm/utils/user.d.ts.map +0 -1
- package/lib/esm/utils/user.js.map +0 -1
- package/lib/esm/utils/validator.d.ts.map +0 -1
- package/lib/esm/utils/validator.js.map +0 -1
|
@@ -19,7 +19,7 @@ function useSCFetchCommentObject({ id = null, commentObject = null, cacheStrateg
|
|
|
19
19
|
const __commentObjectId = commentObject ? commentObject.id : id;
|
|
20
20
|
// CACHE
|
|
21
21
|
const __commentObjectCacheKey = (0, Cache_1.getCommentObjectCacheKey)(__commentObjectId);
|
|
22
|
-
const [obj, setObj] = (0, react_1.useState)(cacheStrategy !== utils_1.CacheStrategies.NETWORK_ONLY ? utils_1.LRUCache.get(__commentObjectCacheKey, commentObject) :
|
|
22
|
+
const [obj, setObj] = (0, react_1.useState)(cacheStrategy !== utils_1.CacheStrategies.NETWORK_ONLY ? utils_1.LRUCache.get(__commentObjectCacheKey, commentObject) : commentObject);
|
|
23
23
|
const [error, setError] = (0, react_1.useState)(null);
|
|
24
24
|
/**
|
|
25
25
|
* Memoized fetchCommentObject
|
|
@@ -64,4 +64,3 @@ function useSCFetchCommentObject({ id = null, commentObject = null, cacheStrateg
|
|
|
64
64
|
return { obj, setObj, error };
|
|
65
65
|
}
|
|
66
66
|
exports.default = useSCFetchCommentObject;
|
|
67
|
-
//# sourceMappingURL=useSCFetchCommentObject.js.map
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.commentsObjectActionTypes = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
7
5
|
const react_1 = require("react");
|
|
8
6
|
const Errors_1 = require("../constants/Errors");
|
|
9
7
|
const types_1 = require("@selfcommunity/types");
|
|
10
8
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
11
9
|
const utils_1 = require("@selfcommunity/utils");
|
|
12
|
-
const useSCFetchFeedObject_1 = __importDefault(require("./useSCFetchFeedObject"));
|
|
10
|
+
const useSCFetchFeedObject_1 = tslib_1.__importDefault(require("./useSCFetchFeedObject"));
|
|
13
11
|
const Cache_1 = require("../constants/Cache");
|
|
14
12
|
const hooks_1 = require("../utils/hooks");
|
|
15
13
|
const pagination_1 = require("../utils/pagination");
|
|
@@ -275,4 +273,3 @@ function useSCFetchCommentObjects(props) {
|
|
|
275
273
|
reload });
|
|
276
274
|
}
|
|
277
275
|
exports.default = useSCFetchCommentObjects;
|
|
278
|
-
//# sourceMappingURL=useSCFetchCommentObjects.js.map
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.contributorsObjectActionTypes = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
7
5
|
const react_1 = require("react");
|
|
8
6
|
const Errors_1 = require("../constants/Errors");
|
|
9
7
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
10
8
|
const utils_1 = require("@selfcommunity/utils");
|
|
11
|
-
const useSCFetchFeedObject_1 = __importDefault(require("./useSCFetchFeedObject"));
|
|
9
|
+
const useSCFetchFeedObject_1 = tslib_1.__importDefault(require("./useSCFetchFeedObject"));
|
|
12
10
|
const Cache_1 = require("../constants/Cache");
|
|
13
11
|
const hooks_1 = require("../utils/hooks");
|
|
14
12
|
/**
|
|
@@ -243,4 +241,3 @@ function useSCFetchContributors(props) {
|
|
|
243
241
|
getPreviousPage });
|
|
244
242
|
}
|
|
245
243
|
exports.default = useSCFetchContributors;
|
|
246
|
-
//# sourceMappingURL=useSCFetchContributors.js.map
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
6
4
|
const react_1 = require("react");
|
|
7
5
|
const Errors_1 = require("../constants/Errors");
|
|
8
6
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
9
7
|
const utils_1 = require("@selfcommunity/utils");
|
|
10
|
-
const useIsComponentMountedRef_1 = __importDefault(require("../utils/hooks/useIsComponentMountedRef"));
|
|
8
|
+
const useIsComponentMountedRef_1 = tslib_1.__importDefault(require("../utils/hooks/useIsComponentMountedRef"));
|
|
11
9
|
const Cache_1 = require("../constants/Cache");
|
|
12
10
|
/**
|
|
13
11
|
:::info
|
|
@@ -87,4 +85,3 @@ function useSCFetchCustomAdv({ id = null, position = null, categoriesId = null,
|
|
|
87
85
|
return { scCustomAdv, setSCCustomAdv, error };
|
|
88
86
|
}
|
|
89
87
|
exports.default = useSCFetchCustomAdv;
|
|
90
|
-
//# sourceMappingURL=useSCFetchCustomAdv.js.map
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.feedDataActionTypes = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
7
5
|
const react_1 = require("react");
|
|
8
6
|
const Errors_1 = require("../constants/Errors");
|
|
9
7
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
10
8
|
const utils_1 = require("@selfcommunity/utils");
|
|
11
9
|
const Cache_1 = require("../constants/Cache");
|
|
12
10
|
const utils_2 = require("@selfcommunity/utils");
|
|
13
|
-
const useIsComponentMountedRef_1 = __importDefault(require("../utils/hooks/useIsComponentMountedRef"));
|
|
11
|
+
const useIsComponentMountedRef_1 = tslib_1.__importDefault(require("../utils/hooks/useIsComponentMountedRef"));
|
|
14
12
|
/**
|
|
15
13
|
* @hidden
|
|
16
14
|
* We have complex state logic that involves multiple sub-values,
|
|
@@ -186,7 +184,7 @@ function useSCFetchFeed(props) {
|
|
|
186
184
|
previous: res.previous,
|
|
187
185
|
},
|
|
188
186
|
});
|
|
189
|
-
onPreviousPage && onPreviousPage(currentPage, currentOffset, count, res);
|
|
187
|
+
onPreviousPage && onPreviousPage(currentPage, currentOffset, count, res.results);
|
|
190
188
|
if (cacheStrategy === utils_1.CacheStrategies.STALE_WHILE_REVALIDATE) {
|
|
191
189
|
revalidate(state.next, true);
|
|
192
190
|
}
|
|
@@ -283,4 +281,3 @@ function useSCFetchFeed(props) {
|
|
|
283
281
|
reset });
|
|
284
282
|
}
|
|
285
283
|
exports.default = useSCFetchFeed;
|
|
286
|
-
//# sourceMappingURL=useSCFetchFeed.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SCIncubatorType } from '@selfcommunity/types';
|
|
3
|
+
import { CacheStrategies } from '@selfcommunity/utils';
|
|
3
4
|
/**
|
|
4
5
|
:::info
|
|
5
6
|
This custom hook is used to fetch an incubator object.
|
|
@@ -7,13 +8,14 @@ import { SCIncubatorType } from '@selfcommunity/types';
|
|
|
7
8
|
* @param object
|
|
8
9
|
* @param object.id
|
|
9
10
|
* @param object.incubator
|
|
11
|
+
* @param object.cacheStrategy
|
|
10
12
|
*/
|
|
11
|
-
export default function useSCFetchIncubator({ id, incubator }: {
|
|
13
|
+
export default function useSCFetchIncubator({ id, incubator, cacheStrategy, }: {
|
|
12
14
|
id?: number;
|
|
13
15
|
incubator?: SCIncubatorType;
|
|
16
|
+
cacheStrategy?: CacheStrategies;
|
|
14
17
|
}): {
|
|
15
18
|
scIncubator: SCIncubatorType;
|
|
16
19
|
setSCIncubator: import("react").Dispatch<import("react").SetStateAction<SCIncubatorType>>;
|
|
17
20
|
error: string;
|
|
18
21
|
};
|
|
19
|
-
//# sourceMappingURL=useSCFetchIncubator.d.ts.map
|
|
@@ -4,6 +4,9 @@ const react_1 = require("react");
|
|
|
4
4
|
const Errors_1 = require("../constants/Errors");
|
|
5
5
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
6
6
|
const utils_1 = require("@selfcommunity/utils");
|
|
7
|
+
const Cache_1 = require("../constants/Cache");
|
|
8
|
+
const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
9
|
+
const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
7
10
|
/**
|
|
8
11
|
:::info
|
|
9
12
|
This custom hook is used to fetch an incubator object.
|
|
@@ -11,9 +14,17 @@ const utils_1 = require("@selfcommunity/utils");
|
|
|
11
14
|
* @param object
|
|
12
15
|
* @param object.id
|
|
13
16
|
* @param object.incubator
|
|
17
|
+
* @param object.cacheStrategy
|
|
14
18
|
*/
|
|
15
|
-
function useSCFetchIncubator({ id = null, incubator = null }) {
|
|
16
|
-
const
|
|
19
|
+
function useSCFetchIncubator({ id = null, incubator = null, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
|
|
20
|
+
const __incubatorId = incubator ? incubator.id : id;
|
|
21
|
+
// CONTEXT
|
|
22
|
+
const scUserContext = (0, SCUserProvider_1.useSCUser)();
|
|
23
|
+
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
24
|
+
// CACHE
|
|
25
|
+
const __incubatorCacheKey = (0, Cache_1.getIncubatorObjectCacheKey)(__incubatorId);
|
|
26
|
+
const __incubator = authUserId ? incubator : (0, utils_1.objectWithoutProperties)(incubator, ['subscribed']);
|
|
27
|
+
const [scIncubator, setSCIncubator] = (0, react_1.useState)(cacheStrategy !== utils_1.CacheStrategies.NETWORK_ONLY ? utils_1.LRUCache.get(__incubatorCacheKey, __incubator) : null);
|
|
17
28
|
const [error, setError] = (0, react_1.useState)(null);
|
|
18
29
|
/**
|
|
19
30
|
* Memoized fetchIncubator
|
|
@@ -21,7 +32,7 @@ function useSCFetchIncubator({ id = null, incubator = null }) {
|
|
|
21
32
|
const fetchIncubator = (0, react_1.useMemo)(() => () => {
|
|
22
33
|
return api_services_1.http
|
|
23
34
|
.request({
|
|
24
|
-
url: api_services_1.Endpoints.GetASpecificIncubator.url({ id:
|
|
35
|
+
url: api_services_1.Endpoints.GetASpecificIncubator.url({ id: __incubatorId }),
|
|
25
36
|
method: api_services_1.Endpoints.GetASpecificIncubator.method,
|
|
26
37
|
})
|
|
27
38
|
.then((res) => {
|
|
@@ -30,24 +41,33 @@ function useSCFetchIncubator({ id = null, incubator = null }) {
|
|
|
30
41
|
}
|
|
31
42
|
return Promise.resolve(res.data);
|
|
32
43
|
});
|
|
33
|
-
}, [
|
|
44
|
+
}, [__incubatorId]);
|
|
34
45
|
/**
|
|
35
46
|
* If id resolve the obj
|
|
36
47
|
*/
|
|
37
48
|
(0, react_1.useEffect)(() => {
|
|
38
|
-
if (id) {
|
|
49
|
+
if (__incubatorId && (!scIncubator || (scIncubator && __incubatorId !== scIncubator.id))) {
|
|
39
50
|
fetchIncubator()
|
|
40
51
|
.then((obj) => {
|
|
41
|
-
|
|
52
|
+
const _i = authUserId ? obj : (0, utils_1.objectWithoutProperties)(obj, ['subscribed']);
|
|
53
|
+
setSCIncubator(_i);
|
|
54
|
+
utils_1.LRUCache.set(__incubatorCacheKey, _i);
|
|
42
55
|
})
|
|
43
56
|
.catch((err) => {
|
|
57
|
+
utils_1.LRUCache.delete(__incubatorCacheKey);
|
|
44
58
|
setError(`Incubator with id ${id} not found`);
|
|
45
59
|
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `Incubator with id ${id} not found`);
|
|
46
60
|
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
|
|
47
61
|
});
|
|
48
62
|
}
|
|
49
|
-
}, [
|
|
63
|
+
}, [__incubatorId]);
|
|
64
|
+
(0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
|
|
65
|
+
if (incubator) {
|
|
66
|
+
const _i = authUserId ? incubator : (0, utils_1.objectWithoutProperties)(incubator, ['subscribed']);
|
|
67
|
+
setSCIncubator(_i);
|
|
68
|
+
utils_1.LRUCache.set(__incubatorCacheKey, _i);
|
|
69
|
+
}
|
|
70
|
+
}, [incubator]);
|
|
50
71
|
return { scIncubator, setSCIncubator, error };
|
|
51
72
|
}
|
|
52
73
|
exports.default = useSCFetchIncubator;
|
|
53
|
-
//# sourceMappingURL=useSCFetchIncubator.js.map
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
12
4
|
const react_1 = require("react");
|
|
13
5
|
const Errors_1 = require("../constants/Errors");
|
|
14
6
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
@@ -57,7 +49,7 @@ const useSCFetchPrivateMessageSnippets = (props) => {
|
|
|
57
49
|
/**
|
|
58
50
|
* Fetch snippets
|
|
59
51
|
*/
|
|
60
|
-
const fetchSnippets = (next = api_services_1.Endpoints.GetSnippets.url()) => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
+
const fetchSnippets = (next = api_services_1.Endpoints.GetSnippets.url()) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
61
53
|
const response = yield api_services_1.http.request({
|
|
62
54
|
url: next,
|
|
63
55
|
method: api_services_1.Endpoints.GetSnippets.method,
|
|
@@ -75,21 +67,20 @@ const useSCFetchPrivateMessageSnippets = (props) => {
|
|
|
75
67
|
if (cacheStrategy === utils_1.CacheStrategies.CACHE_FIRST && snippets) {
|
|
76
68
|
return;
|
|
77
69
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}, [scUserContext]);
|
|
70
|
+
fetchSnippets()
|
|
71
|
+
.then((data) => {
|
|
72
|
+
setData({ snippets: data, isLoading: false });
|
|
73
|
+
utils_1.LRUCache.set(__snippetsCacheKey, data.map((snippet) => {
|
|
74
|
+
const __snippetCacheKey = (0, Cache_1.getPmSnippetObjectCacheKey)(snippet.id);
|
|
75
|
+
utils_1.LRUCache.set(__snippetCacheKey, snippet);
|
|
76
|
+
return snippet.id;
|
|
77
|
+
}));
|
|
78
|
+
})
|
|
79
|
+
.catch((error) => {
|
|
80
|
+
console.log(error);
|
|
81
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, 'Unable to retrieve snippets');
|
|
82
|
+
});
|
|
83
|
+
}, []);
|
|
93
84
|
/**
|
|
94
85
|
* Updated snippets list
|
|
95
86
|
* @param updatedData
|
|
@@ -108,4 +99,3 @@ const useSCFetchPrivateMessageSnippets = (props) => {
|
|
|
108
99
|
return { data, updateSnippets };
|
|
109
100
|
};
|
|
110
101
|
exports.default = useSCFetchPrivateMessageSnippets;
|
|
111
|
-
//# sourceMappingURL=useSCFetchPrivateMessageSnippets.js.map
|
|
@@ -1,44 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
3
|
const react_1 = require("react");
|
|
36
4
|
const Errors_1 = require("../constants/Errors");
|
|
5
|
+
const types_1 = require("@selfcommunity/types");
|
|
37
6
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
38
7
|
const utils_1 = require("@selfcommunity/utils");
|
|
39
8
|
const Cache_1 = require("../constants/Cache");
|
|
40
9
|
const SCPreferencesProvider_1 = require("../components/provider/SCPreferencesProvider");
|
|
41
|
-
const SCFeatures = __importStar(require("../constants/Features"));
|
|
42
10
|
const init = { default: null, reactions: [], isLoading: true };
|
|
43
11
|
// HYDRATE the cache
|
|
44
12
|
const hydrate = (ids) => {
|
|
@@ -78,20 +46,6 @@ const useSCFetchReactions = (props) => {
|
|
|
78
46
|
// STATE
|
|
79
47
|
const reactions = cacheStrategy !== utils_1.CacheStrategies.NETWORK_ONLY ? hydrate(utils_1.LRUCache.get(__reactionsCacheKey, null)) : null;
|
|
80
48
|
const [data, setData] = (0, react_1.useState)(reactions !== null ? { default: reactions.find((reaction) => reaction.id === 1), reactions, isLoading: false } : init);
|
|
81
|
-
/**
|
|
82
|
-
* Fetch reactions
|
|
83
|
-
*/
|
|
84
|
-
const fetchReactions = (next = api_services_1.Endpoints.GetReactions.url()) => __awaiter(void 0, void 0, void 0, function* () {
|
|
85
|
-
const response = yield api_services_1.http.request({
|
|
86
|
-
url: next,
|
|
87
|
-
method: api_services_1.Endpoints.GetReactions.method,
|
|
88
|
-
});
|
|
89
|
-
const data = response.data;
|
|
90
|
-
if (data.next) {
|
|
91
|
-
return data.results.concat(yield fetchReactions(data.next));
|
|
92
|
-
}
|
|
93
|
-
return data.results;
|
|
94
|
-
});
|
|
95
49
|
/**
|
|
96
50
|
* Get reactions
|
|
97
51
|
*/
|
|
@@ -99,10 +53,10 @@ const useSCFetchReactions = (props) => {
|
|
|
99
53
|
if (cacheStrategy === utils_1.CacheStrategies.CACHE_FIRST && reactions) {
|
|
100
54
|
return;
|
|
101
55
|
}
|
|
102
|
-
if (!scPreferences.features.includes(
|
|
56
|
+
if (!scPreferences.features || !scPreferences.features.includes(types_1.SCFeatureName.REACTION)) {
|
|
103
57
|
return;
|
|
104
58
|
}
|
|
105
|
-
|
|
59
|
+
api_services_1.ReactionService.getAllReactionsList()
|
|
106
60
|
.then((data) => {
|
|
107
61
|
setData({ reactions: data, isLoading: false, default: data.find((reaction) => reaction.id === 1) });
|
|
108
62
|
utils_1.LRUCache.set(__reactionsCacheKey, data.map((r) => {
|
|
@@ -119,4 +73,3 @@ const useSCFetchReactions = (props) => {
|
|
|
119
73
|
return data;
|
|
120
74
|
};
|
|
121
75
|
exports.default = useSCFetchReactions;
|
|
122
|
-
//# sourceMappingURL=useSCFetchReactions.js.map
|
|
@@ -14,6 +14,7 @@ export default function useSCFetchUser({ id, user }: {
|
|
|
14
14
|
}): {
|
|
15
15
|
scUser: SCUserType;
|
|
16
16
|
setSCUser: import("react").Dispatch<import("react").SetStateAction<SCUserType>>;
|
|
17
|
+
refresh: () => Promise<void>;
|
|
18
|
+
refreshing: boolean;
|
|
17
19
|
error: string;
|
|
18
20
|
};
|
|
19
|
-
//# sourceMappingURL=useSCFetchUser.d.ts.map
|
|
@@ -4,6 +4,7 @@ const react_1 = require("react");
|
|
|
4
4
|
const Errors_1 = require("../constants/Errors");
|
|
5
5
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
6
6
|
const utils_1 = require("@selfcommunity/utils");
|
|
7
|
+
const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
7
8
|
/**
|
|
8
9
|
:::info
|
|
9
10
|
This custom hook is used to fetch a user object.
|
|
@@ -13,15 +14,20 @@ const utils_1 = require("@selfcommunity/utils");
|
|
|
13
14
|
* @param object.user
|
|
14
15
|
*/
|
|
15
16
|
function useSCFetchUser({ id = null, user = null }) {
|
|
16
|
-
|
|
17
|
+
// CONTEXT
|
|
18
|
+
const scUserContext = (0, SCUserProvider_1.useSCUser)();
|
|
19
|
+
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
20
|
+
const __user = (0, react_1.useMemo)(() => (authUserId ? user : (0, utils_1.objectWithoutProperties)(user, ['connection_status'])), [user]);
|
|
21
|
+
const [scUser, setSCUser] = (0, react_1.useState)(__user);
|
|
17
22
|
const [error, setError] = (0, react_1.useState)(null);
|
|
23
|
+
const [refreshing, setRefreshing] = (0, react_1.useState)(false);
|
|
18
24
|
/**
|
|
19
25
|
* Memoized fetchUser
|
|
20
26
|
*/
|
|
21
27
|
const fetchUser = (0, react_1.useMemo)(() => () => {
|
|
22
28
|
return api_services_1.http
|
|
23
29
|
.request({
|
|
24
|
-
url: api_services_1.Endpoints.User.url({ id: id }),
|
|
30
|
+
url: api_services_1.Endpoints.User.url({ id: user ? user.id : id }),
|
|
25
31
|
method: api_services_1.Endpoints.User.method,
|
|
26
32
|
})
|
|
27
33
|
.then((res) => {
|
|
@@ -30,7 +36,27 @@ function useSCFetchUser({ id = null, user = null }) {
|
|
|
30
36
|
}
|
|
31
37
|
return Promise.resolve(res.data);
|
|
32
38
|
});
|
|
33
|
-
}, [id]);
|
|
39
|
+
}, [id, user]);
|
|
40
|
+
/**
|
|
41
|
+
* Memoized refresh
|
|
42
|
+
*/
|
|
43
|
+
const refresh = (0, react_1.useMemo)(() => () => {
|
|
44
|
+
if (!refreshing) {
|
|
45
|
+
setRefreshing(true);
|
|
46
|
+
return fetchUser()
|
|
47
|
+
.then((obj) => {
|
|
48
|
+
setRefreshing(false);
|
|
49
|
+
setSCUser(authUserId ? obj : (0, utils_1.objectWithoutProperties)(obj, ['connection_status']));
|
|
50
|
+
})
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
setRefreshing(false);
|
|
53
|
+
setError(`Unable to refresh user with id ${id}`);
|
|
54
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, `Unable to refresh user with id ${id}`);
|
|
55
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, err.message);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return Promise.reject();
|
|
59
|
+
}, [fetchUser, refreshing]);
|
|
34
60
|
/**
|
|
35
61
|
* If id resolve the obj
|
|
36
62
|
*/
|
|
@@ -38,7 +64,7 @@ function useSCFetchUser({ id = null, user = null }) {
|
|
|
38
64
|
if (id) {
|
|
39
65
|
fetchUser()
|
|
40
66
|
.then((obj) => {
|
|
41
|
-
setSCUser(obj);
|
|
67
|
+
setSCUser(authUserId ? obj : (0, utils_1.objectWithoutProperties)(obj, ['connection_status']));
|
|
42
68
|
})
|
|
43
69
|
.catch((err) => {
|
|
44
70
|
setError(`User with id ${id} not found`);
|
|
@@ -47,10 +73,9 @@ function useSCFetchUser({ id = null, user = null }) {
|
|
|
47
73
|
});
|
|
48
74
|
}
|
|
49
75
|
else {
|
|
50
|
-
setSCUser(
|
|
76
|
+
setSCUser(__user);
|
|
51
77
|
}
|
|
52
|
-
}, [id,
|
|
53
|
-
return { scUser, setSCUser, error };
|
|
78
|
+
}, [id, __user]);
|
|
79
|
+
return { scUser, setSCUser, refresh, refreshing, error };
|
|
54
80
|
}
|
|
55
81
|
exports.default = useSCFetchUser;
|
|
56
|
-
//# sourceMappingURL=useSCFetchUser.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SCUserType } from '@selfcommunity/types';
|
|
2
|
+
/**
|
|
3
|
+
:::info
|
|
4
|
+
This custom hook is used to fetch if a user is blocked by another user.
|
|
5
|
+
:::
|
|
6
|
+
* @param user
|
|
7
|
+
* @param blockedByUser
|
|
8
|
+
*/
|
|
9
|
+
export default function useSCFetchUserBlockedBy({ user, blockedByUser, sync, }: {
|
|
10
|
+
user: SCUserType;
|
|
11
|
+
blockedByUser?: boolean | null;
|
|
12
|
+
sync?: boolean;
|
|
13
|
+
}): {
|
|
14
|
+
blockedBy: boolean;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
error: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const Errors_1 = require("../constants/Errors");
|
|
5
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
6
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
7
|
+
const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
8
|
+
/**
|
|
9
|
+
:::info
|
|
10
|
+
This custom hook is used to fetch if a user is blocked by another user.
|
|
11
|
+
:::
|
|
12
|
+
* @param user
|
|
13
|
+
* @param blockedByUser
|
|
14
|
+
*/
|
|
15
|
+
function useSCFetchUserBlockedBy({ user = null, blockedByUser = null, sync = true, }) {
|
|
16
|
+
const [blockedBy, setBlockedBy] = (0, react_1.useState)(null);
|
|
17
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
18
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
19
|
+
// CONTEXT
|
|
20
|
+
const scUserContext = (0, SCUserProvider_1.useSCUser)();
|
|
21
|
+
/**
|
|
22
|
+
* Memoized fetchUserBlockedBy
|
|
23
|
+
*/
|
|
24
|
+
const fetchUserBlockedBy = (0, react_1.useMemo)(() => (user, setLoadingStatus = true) => {
|
|
25
|
+
setLoadingStatus && setLoading(true);
|
|
26
|
+
return api_services_1.UserService.checkUserHiddenBy(user.id)
|
|
27
|
+
.then((res) => {
|
|
28
|
+
setLoadingStatus && setLoading(false);
|
|
29
|
+
setBlockedBy(res.is_hidden_by);
|
|
30
|
+
return Promise.resolve(res.is_hidden_by);
|
|
31
|
+
})
|
|
32
|
+
.catch((e) => {
|
|
33
|
+
setLoadingStatus && setLoading(false);
|
|
34
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, 'Unable to load user blocked by.');
|
|
35
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_CORE, e);
|
|
36
|
+
setError(e);
|
|
37
|
+
});
|
|
38
|
+
}, [loading, setBlockedBy]);
|
|
39
|
+
/**
|
|
40
|
+
* If user attempt to get blocked by
|
|
41
|
+
*/
|
|
42
|
+
(0, react_1.useEffect)(() => {
|
|
43
|
+
if (user && blockedBy === null) {
|
|
44
|
+
// if user && blockedBy === null initialize the component
|
|
45
|
+
if (scUserContext.user) {
|
|
46
|
+
// authenticated user
|
|
47
|
+
if (scUserContext.user.id !== user.id) {
|
|
48
|
+
fetchUserBlockedBy(user);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
setBlockedBy(false);
|
|
52
|
+
setLoading(false);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else if (scUserContext.user === null) {
|
|
56
|
+
// anonymous user
|
|
57
|
+
setBlockedBy(blockedByUser);
|
|
58
|
+
setLoading(false);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, [scUserContext.user, user, fetchUserBlockedBy, blockedBy, loading]);
|
|
62
|
+
(0, react_1.useEffect)(() => {
|
|
63
|
+
if (!scUserContext.user && blockedBy !== null) {
|
|
64
|
+
setBlockedBy(blockedByUser);
|
|
65
|
+
}
|
|
66
|
+
}, [scUserContext.user, blockedBy, blockedByUser]);
|
|
67
|
+
/**
|
|
68
|
+
* If sync enabled pull the remote status every 5sec
|
|
69
|
+
*/
|
|
70
|
+
(0, react_1.useEffect)(() => {
|
|
71
|
+
let interval;
|
|
72
|
+
if (scUserContext.user && blockedBy !== null && sync) {
|
|
73
|
+
interval = setInterval(() => {
|
|
74
|
+
fetchUserBlockedBy(user, false);
|
|
75
|
+
}, 5000);
|
|
76
|
+
return () => {
|
|
77
|
+
interval && clearInterval(interval);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}, [scUserContext.user, user, fetchUserBlockedBy, blockedBy]);
|
|
81
|
+
return { blockedBy, loading, error };
|
|
82
|
+
}
|
|
83
|
+
exports.default = useSCFetchUserBlockedBy;
|
|
@@ -20,7 +20,7 @@ interface FetchVoteProps {
|
|
|
20
20
|
* onVote callback
|
|
21
21
|
* @default null
|
|
22
22
|
*/
|
|
23
|
-
onVote?: (contribution: SCFeedObjectType | SCCommentType) => any;
|
|
23
|
+
onVote?: (contribution: SCFeedObjectType | SCCommentType, error: any) => any;
|
|
24
24
|
/**
|
|
25
25
|
* Cache strategy
|
|
26
26
|
* @default CACHE_FIRST
|
|
@@ -52,7 +52,6 @@ export default function useSCFetchVote({ id, contribution, contributionType, onV
|
|
|
52
52
|
contributionVoted: boolean;
|
|
53
53
|
contributionVoteCount: number;
|
|
54
54
|
contributionReaction: SCReactionType;
|
|
55
|
-
contributionReactionsCount: [];
|
|
55
|
+
contributionReactionsCount: any[];
|
|
56
56
|
};
|
|
57
57
|
export {};
|
|
58
|
-
//# sourceMappingURL=useSCFetchVote.d.ts.map
|