mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-24 02:18:15 +01:00
Normalize message attachments
This commit is contained in:
@@ -418,3 +418,27 @@ export class TableIterator<ObjectType extends { id: string }> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function convertOptionalIntegerToBoolean(
|
||||
optionalInteger?: number
|
||||
): boolean | undefined {
|
||||
if (optionalInteger === 1) {
|
||||
return true;
|
||||
}
|
||||
if (optionalInteger === 0) {
|
||||
return false;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function convertOptionalBooleanToNullableInteger(
|
||||
optionalBoolean?: boolean
|
||||
): 1 | 0 | null {
|
||||
if (optionalBoolean === true) {
|
||||
return 1;
|
||||
}
|
||||
if (optionalBoolean === false) {
|
||||
return 0;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user