fix(album): resolve TypeScript strict array access errors
fix(album): resolve TypeScript strict array access errors
This commit is contained in:
@@ -1529,7 +1529,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
|
|
||||||
// Send each media item sequentially
|
// Send each media item sequentially
|
||||||
for (let i = 0; i < medias.length; i++) {
|
for (let i = 0; i < medias.length; i++) {
|
||||||
const media = medias[i]
|
const media = medias[i]!
|
||||||
|
|
||||||
const result = await sendMediaWithRetry(media, i)
|
const result = await sendMediaWithRetry(media, i)
|
||||||
results.push(result)
|
results.push(result)
|
||||||
|
|||||||
@@ -496,10 +496,10 @@ export const generateWAMessageContent = async (
|
|||||||
let expectedVideoCount = 0
|
let expectedVideoCount = 0
|
||||||
|
|
||||||
for (let i = 0; i < medias.length; i++) {
|
for (let i = 0; i < medias.length; i++) {
|
||||||
const media = medias[i]
|
const media = medias[i]!
|
||||||
if (hasNonNullishProperty(media, 'image')) {
|
if (hasNonNullishProperty(media as AnyMessageContent, 'image')) {
|
||||||
expectedImageCount++
|
expectedImageCount++
|
||||||
} else if (hasNonNullishProperty(media, 'video')) {
|
} else if (hasNonNullishProperty(media as AnyMessageContent, 'video')) {
|
||||||
expectedVideoCount++
|
expectedVideoCount++
|
||||||
} else {
|
} else {
|
||||||
throw new Boom(`Album media at index ${i} must have 'image' or 'video' property`, { statusCode: 400 })
|
throw new Boom(`Album media at index ${i} must have 'image' or 'video' property`, { statusCode: 400 })
|
||||||
|
|||||||
Reference in New Issue
Block a user