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
|
plainObj._tmp = originalDoc._tmp; // be sure to send down drop notifs
|
||||||
delete plainObj.filters;
|
delete plainObj.filters;
|
||||||
|
|
||||||
plainObj.notifications = UserNotification.convertNotificationsToSafeJson(originalDoc.notifications);
|
if (originalDoc.notifications) {
|
||||||
|
plainObj.notifications = UserNotification.convertNotificationsToSafeJson(originalDoc.notifications);
|
||||||
|
}
|
||||||
|
|
||||||
return plainObj;
|
return plainObj;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,8 @@ export let schema = new Schema({
|
||||||
* is fixed
|
* is fixed
|
||||||
*/
|
*/
|
||||||
schema.statics.convertNotificationsToSafeJson = function convertNotificationsToSafeJson (notifications) {
|
schema.statics.convertNotificationsToSafeJson = function convertNotificationsToSafeJson (notifications) {
|
||||||
|
if (!notifications) return notifications;
|
||||||
|
|
||||||
return notifications.filter(n => {
|
return notifications.filter(n => {
|
||||||
// Exclude notifications with a nullish value
|
// Exclude notifications with a nullish value
|
||||||
if (!n) return false;
|
if (!n) return false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue