powr-sdk-web 4.2.7 → 4.2.8
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/dist/comments/index.js +3 -3
- package/package.json +1 -1
package/dist/comments/index.js
CHANGED
|
@@ -106,9 +106,9 @@ var PowrBaseComments = function PowrBaseComments(_ref) {
|
|
|
106
106
|
_yield$apiCall = _context.v;
|
|
107
107
|
data = _yield$apiCall.data;
|
|
108
108
|
ok = _yield$apiCall.ok;
|
|
109
|
-
if (ok && data.success) {
|
|
110
|
-
if (Array.isArray(data.
|
|
111
|
-
sortedComments = data.
|
|
109
|
+
if (ok && data !== null && data !== void 0 && data.success) {
|
|
110
|
+
if (Array.isArray(data === null || data === void 0 ? void 0 : data.data)) {
|
|
111
|
+
sortedComments = data.data.sort(function (a, b) {
|
|
112
112
|
return new Date(a.createdAt) - new Date(b.createdAt);
|
|
113
113
|
});
|
|
114
114
|
setComments(sortedComments);
|