From f009099c794ee191baaf96b01b117fac3aacb518 Mon Sep 17 00:00:00 2001 From: Sebastian Rindom Date: Sun, 6 Sep 2020 14:06:03 +0200 Subject: [PATCH] hotfix(medusa-plugin-slack-notification): proper thumbnails in blocks --- .../src/services/slack.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/medusa-plugin-slack-notification/src/services/slack.js b/packages/medusa-plugin-slack-notification/src/services/slack.js index ae3b9ef19e..5ed7343f51 100644 --- a/packages/medusa-plugin-slack-notification/src/services/slack.js +++ b/packages/medusa-plugin-slack-notification/src/services/slack.js @@ -95,17 +95,20 @@ class SlackService extends BaseService { }, } if (lineItem.thumbnail) { - line.accessory.type = "image" + let url = lineItem.thumbnail if ( !lineItem.thumbnail.startsWith("http:") && !lineItem.thumbnail.startsWith("https:") ) { - line.accessory.image_url = `https:${lineItem.thumbnail}` - } else { - line.accessory.image_url = lineItem.thumbnail + url = `https:${lineItem.thumbnail}` + } + + line.accessory = { + type: "image", + alt_text: "Item", + image_url: url } - line.accessory.alt_text = "Item" } blocks.push(line)