Changes to View Once

This commit is contained in:
Scott Nonnenberg 2019-08-05 13:53:15 -07:00
parent 9d88abdb90
commit d42eb2126e
14 changed files with 152 additions and 167 deletions

View file

@ -52,22 +52,12 @@
const toAgeOut = await window.Signal.Data.getNextTapToViewMessageToAgeOut({
Message: Whisper.Message,
});
const toExpire = await window.Signal.Data.getNextTapToViewMessageToExpire({
Message: Whisper.Message,
});
if (!toAgeOut && !toExpire) {
if (!toAgeOut) {
return;
}
const ageOutAt = toAgeOut
? toAgeOut.get('received_at') + THIRTY_DAYS
: Number.MAX_VALUE;
const expireAt = toExpire
? toExpire.get('messageTimerExpiresAt')
: Number.MAX_VALUE;
const nextCheck = Math.min(ageOutAt, expireAt);
const nextCheck = toAgeOut.get('received_at') + THIRTY_DAYS;
Whisper.TapToViewMessagesListener.nextCheck = nextCheck;
window.log.info(