mirror of
				https://github.com/HabitRPG/habitica.git
				synced 2025-10-30 20:52:29 +01:00 
			
		
		
		
	Compare commits
	
		
			10 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 2af99d7c65 | ||
|  | 4e01b14874 | ||
|  | a3ddd0746c | ||
|  | 94845ec629 | ||
|  | 7e63856e64 | ||
|  | b430b6ccb6 | ||
|  | 7859f20a40 | ||
|  | fd1d1da509 | ||
|  | 014b367f56 | ||
|  | 4580b33e43 | 
							
								
								
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "habitica", | ||||
|   "version": "4.24.2", | ||||
|   "version": "4.24.5", | ||||
|   "lockfileVersion": 1, | ||||
|   "requires": true, | ||||
|   "dependencies": { | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| { | ||||
|   "name": "habitica", | ||||
|   "description": "A habit tracker app which treats your goals like a Role Playing Game.", | ||||
|   "version": "4.24.2", | ||||
|   "version": "4.24.5", | ||||
|   "main": "./website/server/index.js", | ||||
|   "dependencies": { | ||||
|     "@slack/client": "^3.8.1", | ||||
|   | ||||
| @@ -13,7 +13,7 @@ import forEach from 'lodash/forEach'; | ||||
| import moment from 'moment'; | ||||
|  | ||||
| describe('shared.ops.purchase', () => { | ||||
|   const SEASONAL_FOOD = 'Cake_Base'; | ||||
|   const SEASONAL_FOOD = 'Meat'; | ||||
|   let user; | ||||
|   let goldPoints = 40; | ||||
|   let gemsBought = 40; | ||||
|   | ||||
| @@ -103,7 +103,7 @@ div | ||||
|  | ||||
|   /* Push progress bar above modals */ | ||||
|   #nprogress .bar { | ||||
|     z-index: 1043; /* Must stay above nav bar */ | ||||
|     z-index: 1043 !important; /* Must stay above nav bar */ | ||||
|   } | ||||
| </style> | ||||
|  | ||||
|   | ||||
| @@ -11,10 +11,6 @@ module.exports = { | ||||
|   ], | ||||
|  | ||||
|   pinnedSets: { | ||||
|     warrior: 'winter2018GiftWrappedSet', | ||||
|     wizard: 'winter2018ConfettiSet', | ||||
|     rogue: 'winter2018ReindeerSet', | ||||
|     healer: 'winter2018MistletoeSet', | ||||
|   }, | ||||
|  | ||||
|   availableSpells: [ | ||||
|   | ||||
| @@ -1,5 +1,4 @@ | ||||
| import { authWithHeaders } from '../../middlewares/auth'; | ||||
| import _ from 'lodash'; | ||||
| import { | ||||
|   NotFound, | ||||
| } from '../../libs/errors'; | ||||
| @@ -30,8 +29,8 @@ api.readNotification = { | ||||
|     let validationErrors = req.validationErrors(); | ||||
|     if (validationErrors) throw validationErrors; | ||||
|  | ||||
|     let index = _.findIndex(user.notifications, { | ||||
|       id: req.params.notificationId, | ||||
|     const index = user.notifications.findIndex(n => { | ||||
|       return n.id === req.params.notificationId; | ||||
|     }); | ||||
|  | ||||
|     if (index === -1) { | ||||
| @@ -72,10 +71,10 @@ api.readNotifications = { | ||||
|     let validationErrors = req.validationErrors(); | ||||
|     if (validationErrors) throw validationErrors; | ||||
|  | ||||
|     let notifications = req.body.notificationIds; | ||||
|     for (let notification of notifications) { | ||||
|       let index = _.findIndex(user.notifications, { | ||||
|         id: notification, | ||||
|     let notificationsIds = req.body.notificationIds; | ||||
|     for (let notificationId of notificationsIds) { | ||||
|       const index = user.notifications.findIndex(n => { | ||||
|         return n.id === notificationId; | ||||
|       }); | ||||
|  | ||||
|       if (index === -1) { | ||||
| @@ -86,7 +85,7 @@ api.readNotifications = { | ||||
|     } | ||||
|  | ||||
|     await user.update({ | ||||
|       $pull: { notifications: { id: { $in: notifications } } }, | ||||
|       $pull: { notifications: { id: { $in: notificationsIds } } }, | ||||
|     }).exec(); | ||||
|  | ||||
|     // Update the user version field manually, | ||||
| @@ -122,8 +121,8 @@ api.seeNotification = { | ||||
|  | ||||
|     const notificationId = req.params.notificationId; | ||||
|  | ||||
|     let notification = _.find(user.notifications, { | ||||
|       id: notificationId, | ||||
|     const notification = user.notifications.find(n => { | ||||
|       return n.id === notificationId; | ||||
|     }); | ||||
|  | ||||
|     if (!notification) { | ||||
| @@ -172,8 +171,8 @@ api.seeNotifications = { | ||||
|     let notificationsIds = req.body.notificationIds; | ||||
|  | ||||
|     for (let notificationId of notificationsIds) { | ||||
|       let notification = _.find(user.notifications, { | ||||
|         id: notificationId, | ||||
|       const notification = user.notifications.find(n => { | ||||
|         return n.id === notificationId; | ||||
|       }); | ||||
|  | ||||
|       if (!notification) { | ||||
|   | ||||
| @@ -38,14 +38,22 @@ export let schema = new Schema({ | ||||
|     type: String, | ||||
|     default: uuid, | ||||
|     validate: [validator.isUUID, 'Invalid uuid.'], | ||||
|     required: true, | ||||
|     // required: true, // @TODO: Add these back once we figure out the issue with notifications | ||||
|   }, | ||||
|   type: { | ||||
|     type: String, | ||||
|     // required: true, | ||||
|     enum: NOTIFICATION_TYPES, | ||||
|   }, | ||||
|   type: {type: String, required: true, enum: NOTIFICATION_TYPES}, | ||||
|   data: {type: Schema.Types.Mixed, default: () => { | ||||
|     return {}; | ||||
|   }}, | ||||
|   // A field to mark the notification as seen without deleting it, optional use | ||||
|   seen: {type: Boolean, required: true, default: () => false}, | ||||
|   seen: { | ||||
|     type: Boolean, | ||||
|     // required: true, | ||||
|     default: () => false, | ||||
|   }, | ||||
| }, { | ||||
|   strict: true, | ||||
|   minimize: false, // So empty objects are returned | ||||
|   | ||||
		Reference in New Issue
	
	Block a user