Update messages.ts

Remove string type and revert back to boolean.
This commit is contained in:
ShellTear
2023-07-19 22:18:20 +03:00
committed by GitHub
parent db3518fd1e
commit f18c9483cc

View File

@@ -31,7 +31,7 @@ import { downloadContentFromMessage, encryptedStream, generateThumbnail, getAudi
type MediaUploadData = {
media: WAMediaUpload
caption?: string
ptt?: boolean | string
ptt?: boolean
seconds?: number
gifPlayback?: boolean
fileName?: string
@@ -155,8 +155,8 @@ export const prepareWAMessageMedia = async(
const requiresDurationComputation = mediaType === 'audio' && typeof uploadData.seconds === 'undefined'
const requiresThumbnailComputation = (mediaType === 'image' || mediaType === 'video') &&
(typeof uploadData['jpegThumbnail'] === 'undefined')
const requiresWaveformProcessing = mediaType === 'audio' && uploadData.ptt === 'true' || true
const requiresAudioBackground = options.backgroundColor && mediaType === 'audio' && uploadData.ptt === 'true' || true
const requiresWaveformProcessing = mediaType === 'audio' && uploadData.ptt === true
const requiresAudioBackground = options.backgroundColor && mediaType === 'audio' && uploadData.ptt === true
const requiresOriginalForSomeProcessing = requiresDurationComputation || requiresThumbnailComputation
const {
mediaKey,