🐛 修复特定情况下的数据遗漏

This commit is contained in:
目棃
2024-09-03 15:11:10 +08:00
parent 5e53baf091
commit 3425919816
2 changed files with 6 additions and 2 deletions

View File

@@ -60,6 +60,11 @@ function getParsedData(data: TGApp.Plugins.Mys.SctPost.Base[]): TGApp.Plugins.My
const text = parsedText[i]; const text = parsedText[i];
child.push(parsedText[i]); child.push(parsedText[i]);
if (text.insert === "\n") { if (text.insert === "\n") {
if (child.length === 1) {
res.push(child[0]);
child = [];
continue;
}
cur = { cur = {
insert: "", insert: "",
attributes: text.attributes, attributes: text.attributes,
@@ -70,7 +75,7 @@ function getParsedData(data: TGApp.Plugins.Mys.SctPost.Base[]): TGApp.Plugins.My
child = []; child = [];
} }
} }
if (check !== parsedText.length - 1 && child.length > 1) res.push(...child); if (check !== parsedText.length - 1 && child.length > 0) res.push(...child);
} }
if (res.length === 0 && child.length > 0) res.push(...child); if (res.length === 0 && child.length > 0) res.push(...child);
return res; return res;

View File

@@ -45,7 +45,6 @@
@click="showReply()" @click="showReply()"
> >
<v-icon size="small">mdi-message-text</v-icon> <v-icon size="small">mdi-message-text</v-icon>
{{ props.modelValue.sub_replies.length }}
<v-menu <v-menu
submenu submenu
activator="parent" activator="parent"