Avoid mute timeouts with invalid delay values
This commit is contained in:
parent
53eb51a370
commit
68ab4bd0d9
2 changed files with 10 additions and 1 deletions
|
@ -26,7 +26,7 @@ import { getNotificationTextForMessage } from '../util/getNotificationTextForMes
|
|||
import { getNotificationDataForMessage } from '../util/getNotificationDataForMessage';
|
||||
import type { ProfileNameChangeType } from '../util/getStringForProfileChange';
|
||||
import type { AttachmentType, ThumbnailType } from '../types/Attachment';
|
||||
import { toDayMillis } from '../util/timestamp';
|
||||
import { MAX_SAFE_TIMEOUT_DELAY, toDayMillis } from '../util/timestamp';
|
||||
import { areWeAdmin } from '../util/areWeAdmin';
|
||||
import { isBlocked } from '../util/isBlocked';
|
||||
import { getAboutText } from '../util/getAboutText';
|
||||
|
@ -5372,6 +5372,13 @@ export class ConversationModel extends window.Backbone
|
|||
return;
|
||||
}
|
||||
|
||||
if (delay > MAX_SAFE_TIMEOUT_DELAY) {
|
||||
log.warn(
|
||||
'startMuteTimer: timeout is larger than maximum setTimeout delay'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
this.#muteTimer = setTimeout(() => this.setMuteExpiration(0), delay);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue