From f27ddf2e229a3a80158b4dc5cbf92321f664280b Mon Sep 17 00:00:00 2001 From: Alex Junior Date: Mon, 21 Feb 2022 15:19:40 -0300 Subject: [PATCH] chore: migrate getFileUrlFromMessage to ts (#3734) --- .../{getFileUrlFromMessage.js => getFileUrlFromMessage.ts} | 2 +- app/views/MessagesView/index.tsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) rename app/lib/methods/helpers/{getFileUrlFromMessage.js => getFileUrlFromMessage.ts} (80%) diff --git a/app/lib/methods/helpers/getFileUrlFromMessage.js b/app/lib/methods/helpers/getFileUrlFromMessage.ts similarity index 80% rename from app/lib/methods/helpers/getFileUrlFromMessage.js rename to app/lib/methods/helpers/getFileUrlFromMessage.ts index c5a34ba04..ea3fb64ff 100644 --- a/app/lib/methods/helpers/getFileUrlFromMessage.js +++ b/app/lib/methods/helpers/getFileUrlFromMessage.ts @@ -1,4 +1,4 @@ -export default function (message) { +export default function (message: { type: string; url: string }) { if (/image/.test(message.type)) { return { image_url: message.url }; } diff --git a/app/views/MessagesView/index.tsx b/app/views/MessagesView/index.tsx index 89cd966ad..0912ccf67 100644 --- a/app/views/MessagesView/index.tsx +++ b/app/views/MessagesView/index.tsx @@ -71,6 +71,8 @@ interface IMessageItem { msg?: string; starred: boolean; pinned: boolean; + type: string; + url: string; } interface IParams {