提交 7baf3981 编写于 作者: AndroidLeaves's avatar AndroidLeaves

update

上级 2a783c55
......@@ -464,10 +464,13 @@ class Widget extends BaseWidget {
} else {
await this.renderSearchResultView(response, async (event) => {
const { title, link } = event;
await this.generateAlert(`热榜内容`, `已成功添加«${title}»\n关闭窗口重新运行`, ['确定']);
const hotbanArr = this.getHotban('[]');
hotbanArr.push({ title, link: `${this.defaultPreference.domain}${link}` });
this.useFileManager().writeStringCache('hotban', JSON.stringify(hotbanArr));
const findItem = hotbanArr.find(hotban => hotban.title == title);
if (findItem == undefined) {
hotbanArr.push({ title, link: `${this.defaultPreference.domain}${link}` });
this.useFileManager().writeStringCache('hotban', JSON.stringify(hotbanArr));
}
await this.generateAlert(`热榜内容`, `已成功添加«${title}»\n关闭窗口重新运行`, ['确定']);
this.rerunWidget();
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册