We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa1a7f1 commit 7776f4bCopy full SHA for 7776f4b
packages/react-renderer-demo/src/app/src/components/notification-panel.js
@@ -40,7 +40,7 @@ const getNotifications = () => {
40
const query = `?orderBy="expired-at"&startAt="${new Date().toISOString()}"&limitToFirst=10`;
41
return fetch(`https://data-driven-forms.firebaseio.com/notifications.json${query}`)
42
.then((data) => data.json())
43
- .then((data) => data || []);
+ .then((data) => data.filter(Boolean).sort((a, b) => b['created-at'].localeCompare(a['created-at'])) || []);
44
};
45
46
const createNotificationId = (notification) => `${notification['created-at']}-${notification['expired-at']}`;
0 commit comments