mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
Merge branch 'develop' into party-chat-translations
This commit is contained in:
@@ -437,7 +437,11 @@ schema.statics.toJSONCleanChat = async function groupToJSONCleanChat (group, use
|
||||
|
||||
// Convert to timestamps because Android expects it
|
||||
toJSON.chat.forEach(chat => {
|
||||
chat.timestamp = chat.timestamp ? chat.timestamp.getTime() : new Date().getTime();
|
||||
// old chats are saved with a numeric timestamp
|
||||
// new chats use `Date` which then has to be converted to the numeric timestamp
|
||||
if (chat.timestamp && chat.timestamp.getTime) {
|
||||
chat.timestamp = chat.timestamp.getTime();
|
||||
}
|
||||
});
|
||||
|
||||
return toJSON;
|
||||
|
||||
Reference in New Issue
Block a user