From efb7a0a61b267e07c01de67f006dcff7276a841a Mon Sep 17 00:00:00 2001 From: SHL-COOL <31879581+SHL-COOL@users.noreply.github.com> Date: Mon, 9 Oct 2023 20:46:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=97=B6=E9=97=B4=E8=BD=B4=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=9B=BE=E7=89=87=E5=A4=84=E7=90=86=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20(#1615)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 时间轴错误图片处理优化 * 捕获其他有可能的错误 --------- Co-authored-by: SHL-COOL <806209350@qq.com> --- src/options/views/UserDataTimeline.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/options/views/UserDataTimeline.vue b/src/options/views/UserDataTimeline.vue index ae2c9f9c7..d17421232 100644 --- a/src/options/views/UserDataTimeline.vue +++ b/src/options/views/UserDataTimeline.vue @@ -309,7 +309,6 @@ export default Vue.extend({ this.init(); }, mounted() { - this.replaceImageToBase64(); }, methods: { init() { @@ -516,9 +515,6 @@ export default Vue.extend({ }); this.infos.total.ratio = this.getRatio(this.infos.total); - setTimeout(() => { - this.replaceImageToBase64(); - }, 200); }, getRatio(info: any): number { let downloaded = info.downloaded as number; @@ -546,6 +542,7 @@ export default Vue.extend({ setTimeout(() => { let div = this.$refs.userDataCard as HTMLDivElement; domtoimage.toBlob(div, { + imagePlaceholder: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", filter: (node) => { if (node.nodeType === 1) { return !(node as Element).classList.contains('by_pass_canvas') @@ -558,6 +555,9 @@ export default Vue.extend({ FileSaver.saveAs(blob, "PT-Plugin-Plus-UserData.png"); } this.shareing = false; + }).catch(error => { + console.log('error:', error); + this.shareing = false; }); }, 500); },