mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Introduce smaller incoming size limit for text attachments
This commit is contained in:
@@ -43,6 +43,22 @@ export const getMaximumIncomingAttachmentSizeInKb = (
|
||||
}
|
||||
};
|
||||
|
||||
export const getMaximumIncomingTextAttachmentSizeInKb = (
|
||||
getValue: typeof RemoteConfig.getValue
|
||||
): number => {
|
||||
try {
|
||||
return (
|
||||
parseIntOrThrow(
|
||||
getValue('global.textAttachmentLimitBytes'),
|
||||
'getMaximumIncomingTextAttachmentSizeInKb'
|
||||
) / KIBIBYTE
|
||||
);
|
||||
} catch (_error) {
|
||||
// TODO: DESKTOP-6314. We're not gonna log until the new flag is fully deployed
|
||||
return KIBIBYTE * 5;
|
||||
}
|
||||
};
|
||||
|
||||
export function getRenderDetailsForLimit(limitKb: number): {
|
||||
limit: number;
|
||||
units: string;
|
||||
|
||||
Reference in New Issue
Block a user