Story send: Send sync message even in partial failure
This commit is contained in:
parent
2d5c154e2a
commit
0e49f7906d
5 changed files with 84 additions and 30 deletions
|
@ -40,11 +40,9 @@ export async function sendDeleteForEveryoneMessage(
|
|||
const messageModel = window.MessageController.register(messageId, message);
|
||||
|
||||
const timestamp = Date.now();
|
||||
if (
|
||||
timestamp - targetTimestamp >
|
||||
(deleteForEveryoneDuration || THREE_HOURS)
|
||||
) {
|
||||
throw new Error('Cannot send DOE for a message older than three hours');
|
||||
const maxDuration = deleteForEveryoneDuration || THREE_HOURS;
|
||||
if (timestamp - targetTimestamp > maxDuration) {
|
||||
throw new Error(`Cannot send DOE for a message older than ${maxDuration}`);
|
||||
}
|
||||
|
||||
messageModel.set({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue