@selfcommunity/react-ui 0.7.13-alpha.0 → 0.7.13-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.
- package/lib/cjs/components/CustomAdv/CustomAdv.d.ts +1 -1
- package/lib/cjs/components/GroupInfoWidget/GroupInfoWidget.js +1 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +1 -1
- package/lib/cjs/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.js +2 -2
- package/lib/esm/components/CustomAdv/CustomAdv.d.ts +1 -1
- package/lib/esm/components/GroupInfoWidget/GroupInfoWidget.js +1 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +1 -1
- package/lib/esm/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.js +2 -2
- package/lib/umd/react-ui.js +1 -1
- package/package.json +4 -4
|
@@ -145,7 +145,7 @@ function GroupInfoWidget(inProps) {
|
|
|
145
145
|
} })))))),
|
|
146
146
|
react_1.default.createElement(material_1.Typography, { variant: "body2", className: classes.date },
|
|
147
147
|
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupInfoWidget.date", defaultMessage: "ui.groupInfoWidget.date", values: { date: intl.formatDate(scGroup.created_at, { day: 'numeric', year: 'numeric', month: 'long' }) } })),
|
|
148
|
-
react_1.default.createElement(material_1.Typography, {
|
|
148
|
+
react_1.default.createElement(material_1.Typography, { component: "div", className: classes.admin },
|
|
149
149
|
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupInfoWidget.admin", defaultMessage: "ui.groupInfoWidget.admin", values: {
|
|
150
150
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
151
151
|
// @ts-ignore
|
|
@@ -130,7 +130,7 @@ function PrivateMessageThread(inProps) {
|
|
|
130
130
|
// HOOKS
|
|
131
131
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
132
132
|
// @ts-ignore
|
|
133
|
-
const { scUser } = (0, react_core_1.useSCFetchUser)({ id: threadObj, threadObj });
|
|
133
|
+
const { scUser } = (0, react_core_1.useSCFetchUser)({ id: isNumber && threadObj, threadObj });
|
|
134
134
|
const messagesEndRef = (0, react_1.useRef)(null);
|
|
135
135
|
const scrollToBottom = () => {
|
|
136
136
|
var _a;
|
|
@@ -108,7 +108,7 @@ function UserSubscribedGroupsWidget(inProps) {
|
|
|
108
108
|
// EFFECTS
|
|
109
109
|
(0, react_1.useEffect)(() => {
|
|
110
110
|
let _t;
|
|
111
|
-
if (groupsEnabled
|
|
111
|
+
if (groupsEnabled && (0, utils_1.isInteger)(userId) && scUserContext.user !== undefined) {
|
|
112
112
|
_t = setTimeout(_initComponent);
|
|
113
113
|
return () => {
|
|
114
114
|
_t && clearTimeout(_t);
|
|
@@ -122,7 +122,7 @@ function UserSubscribedGroupsWidget(inProps) {
|
|
|
122
122
|
onHeightChange && onHeightChange();
|
|
123
123
|
}, [state.results.length]);
|
|
124
124
|
(0, react_1.useEffect)(() => {
|
|
125
|
-
if (
|
|
125
|
+
if (!groupsEnabled && !scUserContext.user && !(0, utils_1.isInteger)(userId)) {
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
else if (cacheStrategy === utils_1.CacheStrategies.NETWORK_ONLY) {
|
|
@@ -143,7 +143,7 @@ export default function GroupInfoWidget(inProps) {
|
|
|
143
143
|
} })))))),
|
|
144
144
|
React.createElement(Typography, { variant: "body2", className: classes.date },
|
|
145
145
|
React.createElement(FormattedMessage, { id: "ui.groupInfoWidget.date", defaultMessage: "ui.groupInfoWidget.date", values: { date: intl.formatDate(scGroup.created_at, { day: 'numeric', year: 'numeric', month: 'long' }) } })),
|
|
146
|
-
React.createElement(Typography, {
|
|
146
|
+
React.createElement(Typography, { component: "div", className: classes.admin },
|
|
147
147
|
React.createElement(FormattedMessage, { id: "ui.groupInfoWidget.admin", defaultMessage: "ui.groupInfoWidget.admin", values: {
|
|
148
148
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
149
149
|
// @ts-ignore
|
|
@@ -128,7 +128,7 @@ export default function PrivateMessageThread(inProps) {
|
|
|
128
128
|
// HOOKS
|
|
129
129
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
130
130
|
// @ts-ignore
|
|
131
|
-
const { scUser } = useSCFetchUser({ id: threadObj, threadObj });
|
|
131
|
+
const { scUser } = useSCFetchUser({ id: isNumber && threadObj, threadObj });
|
|
132
132
|
const messagesEndRef = useRef(null);
|
|
133
133
|
const scrollToBottom = () => {
|
|
134
134
|
var _a;
|
|
@@ -106,7 +106,7 @@ export default function UserSubscribedGroupsWidget(inProps) {
|
|
|
106
106
|
// EFFECTS
|
|
107
107
|
useEffect(() => {
|
|
108
108
|
let _t;
|
|
109
|
-
if (groupsEnabled
|
|
109
|
+
if (groupsEnabled && isInteger(userId) && scUserContext.user !== undefined) {
|
|
110
110
|
_t = setTimeout(_initComponent);
|
|
111
111
|
return () => {
|
|
112
112
|
_t && clearTimeout(_t);
|
|
@@ -120,7 +120,7 @@ export default function UserSubscribedGroupsWidget(inProps) {
|
|
|
120
120
|
onHeightChange && onHeightChange();
|
|
121
121
|
}, [state.results.length]);
|
|
122
122
|
useEffect(() => {
|
|
123
|
-
if (
|
|
123
|
+
if (!groupsEnabled && !scUserContext.user && !isInteger(userId)) {
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
126
|
else if (cacheStrategy === CacheStrategies.NETWORK_ONLY) {
|