@selfcommunity/react-ui 0.7.0-alpha.350 → 0.7.0-alpha.351

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.
@@ -212,7 +212,7 @@ function CommentObject(inProps) {
212
212
  * Handle comment delete
213
213
  */
214
214
  function handleDelete(comment) {
215
- if (comment.parent) {
215
+ if (comment.parent && obj.latest_comments) {
216
216
  const _latestComment = obj.latest_comments.map((c) => {
217
217
  if (c.id === comment.id) {
218
218
  c.deleted = !c.deleted;
@@ -231,7 +231,7 @@ function CommentObject(inProps) {
231
231
  * Handle comment delete
232
232
  */
233
233
  function handleHide(comment) {
234
- if (comment.parent) {
234
+ if (comment.parent && obj.latest_comments) {
235
235
  const _latestComment = obj.latest_comments.map((c) => {
236
236
  if (c.id === comment.id) {
237
237
  c.collapsed = !c.collapsed;
@@ -248,7 +248,7 @@ function CommentObject(inProps) {
248
248
  * Handle comment restore
249
249
  */
250
250
  function handleRestore(comment) {
251
- if (comment.parent) {
251
+ if (comment.parent && obj.latest_comments) {
252
252
  const _latestComment = obj.latest_comments.map((c) => {
253
253
  if (c.id === comment.id) {
254
254
  c.deleted = false;
@@ -210,7 +210,7 @@ export default function CommentObject(inProps) {
210
210
  * Handle comment delete
211
211
  */
212
212
  function handleDelete(comment) {
213
- if (comment.parent) {
213
+ if (comment.parent && obj.latest_comments) {
214
214
  const _latestComment = obj.latest_comments.map((c) => {
215
215
  if (c.id === comment.id) {
216
216
  c.deleted = !c.deleted;
@@ -229,7 +229,7 @@ export default function CommentObject(inProps) {
229
229
  * Handle comment delete
230
230
  */
231
231
  function handleHide(comment) {
232
- if (comment.parent) {
232
+ if (comment.parent && obj.latest_comments) {
233
233
  const _latestComment = obj.latest_comments.map((c) => {
234
234
  if (c.id === comment.id) {
235
235
  c.collapsed = !c.collapsed;
@@ -246,7 +246,7 @@ export default function CommentObject(inProps) {
246
246
  * Handle comment restore
247
247
  */
248
248
  function handleRestore(comment) {
249
- if (comment.parent) {
249
+ if (comment.parent && obj.latest_comments) {
250
250
  const _latestComment = obj.latest_comments.map((c) => {
251
251
  if (c.id === comment.id) {
252
252
  c.deleted = false;