mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-05 13:33:00 +00:00
Merge branch 'release' into develop
This commit is contained in:
commit
553dc116c5
2 changed files with 5 additions and 1 deletions
|
|
@ -18,7 +18,9 @@ schema.plugin(baseModel, {
|
|||
plainObj._tmp = originalDoc._tmp; // be sure to send down drop notifs
|
||||
delete plainObj.filters;
|
||||
|
||||
if (originalDoc.notifications) {
|
||||
plainObj.notifications = UserNotification.convertNotificationsToSafeJson(originalDoc.notifications);
|
||||
}
|
||||
|
||||
return plainObj;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ export let schema = new Schema({
|
|||
* is fixed
|
||||
*/
|
||||
schema.statics.convertNotificationsToSafeJson = function convertNotificationsToSafeJson (notifications) {
|
||||
if (!notifications) return notifications;
|
||||
|
||||
return notifications.filter(n => {
|
||||
// Exclude notifications with a nullish value
|
||||
if (!n) return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue