diff --git a/packages/web-api/package.json b/packages/web-api/package.json index a56989095..b6bd8702c 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -65,7 +65,7 @@ "source-map-support": "^0.5.21", "ts-node": "^10", "tsd": "^0.31.1", - "typescript": "5.3.3" + "typescript": "5.5.4" }, "tsd": { "directory": "test/types" diff --git a/packages/web-api/src/file-upload.ts b/packages/web-api/src/file-upload.ts index 09ff422ee..2f1548a07 100644 --- a/packages/web-api/src/file-upload.ts +++ b/packages/web-api/src/file-upload.ts @@ -235,13 +235,19 @@ export function getAllFileUploadsToComplete( if (file_id) { const compareString = `:::${channel_id}:::${thread_ts}:::${initial_comment}`; if (!Object.prototype.hasOwnProperty.call(toComplete, compareString)) { - toComplete[compareString] = { - files: [{ id: file_id, title }], - channel_id, - initial_comment, - }; - if (thread_ts) { - toComplete[compareString].thread_ts = upload.thread_ts; + if (channel_id && thread_ts) { + toComplete[compareString] = { + files: [{ id: file_id, title }], + channel_id, + initial_comment, + thread_ts, + }; + } else { + toComplete[compareString] = { + files: [{ id: file_id, title }], + channel_id, + initial_comment, + }; } if ('token' in upload) { toComplete[compareString].token = upload.token;