From 060382b3a75cb3627b3613d5c05388b78fddbd24 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Thu, 30 Nov 2023 14:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=20tag=5Flist?= =?UTF-8?q?=20=E5=AD=97=E6=AE=B5=20undefined=20=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #63 --- src/plugins/Mys/utils/parsePost.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/plugins/Mys/utils/parsePost.ts b/src/plugins/Mys/utils/parsePost.ts index 423cbb7d..274abfdc 100644 --- a/src/plugins/Mys/utils/parsePost.ts +++ b/src/plugins/Mys/utils/parsePost.ts @@ -1,7 +1,7 @@ /** * @file plugins Mys utils parsePost.ts * @description 用于解析Mys数据的工具 - * @since Beta v0.3.5 + * @since Beta v0.3.7 */ import * as colorConvert from "color-convert"; @@ -468,7 +468,7 @@ function emojiParser(data: TGApp.Plugins.Mys.SctPost.Text): HTMLImageElement { /** * @description 解析大别野房间的卡片 - * @since Beta v0.3.4 + * @since Beta v0.3.7 * @param {TGApp.Plugins.Mys.SctPost.VillaCard} data Mys数据 * @returns {HTMLDivElement} 解析后的大别野房间的卡片 */ @@ -517,12 +517,14 @@ function parseVillaCard(data: TGApp.Plugins.Mys.SctPost.VillaCard): HTMLDivEleme numberDiv.classList.add("mys-post-villa-card-tag"); numberDiv.innerText = `${data.insert.villa_card.villa_member_num}人在聊`; midDiv.appendChild(numberDiv); - data.insert.villa_card.tag_list.forEach((tag) => { - const tagDiv = document.createElement("div"); - tagDiv.classList.add("mys-post-villa-card-tag"); - tagDiv.innerText = tag; - midDiv.appendChild(tagDiv); - }); + if (data.insert.villa_card.tag_list !== undefined) { + data.insert.villa_card.tag_list.forEach((tag) => { + const tagDiv = document.createElement("div"); + tagDiv.classList.add("mys-post-villa-card-tag"); + tagDiv.innerText = tag; + midDiv.appendChild(tagDiv); + }); + } flexDiv.appendChild(midDiv); const bottomDiv = document.createElement("div"); bottomDiv.classList.add("mys-post-villa-card-bottom");