Browse Source

fix date panic

loopout2
Evan Feenstra 4 years ago
parent
commit
84a69d61d7
  1. 5
      dist/src/controllers/chatTribes.js
  2. 2
      dist/src/controllers/chatTribes.js.map
  3. 5
      src/controllers/chatTribes.ts

5
dist/src/controllers/chatTribes.js

@ -438,7 +438,10 @@ function replayChatHistory(chat, contact) {
content = JSON.parse(m.remoteMessageContent); content = JSON.parse(m.remoteMessageContent);
} }
catch (e) { } catch (e) { }
const dateString = m.date && m.date.toISOString(); let mdate = m.date;
if (!mdate)
mdate = new Date();
const dateString = mdate.toISOString();
let mediaKeyMap; let mediaKeyMap;
let newMediaTerms; let newMediaTerms;
if (m.type === constants.message_types.attachment) { if (m.type === constants.message_types.attachment) {

2
dist/src/controllers/chatTribes.js.map

File diff suppressed because one or more lines are too long

5
src/controllers/chatTribes.ts

@ -440,7 +440,10 @@ export async function replayChatHistory(chat, contact) {
let content = '' let content = ''
try {content = JSON.parse(m.remoteMessageContent)} catch(e) {} try {content = JSON.parse(m.remoteMessageContent)} catch(e) {}
const dateString = m.date&&m.date.toISOString() let mdate = m.date
if(!mdate) mdate = new Date()
const dateString = mdate.toISOString()
let mediaKeyMap let mediaKeyMap
let newMediaTerms let newMediaTerms
if(m.type===constants.message_types.attachment) { if(m.type===constants.message_types.attachment) {

Loading…
Cancel
Save