Skip to content

Commit

Permalink
fix:时间轴错误图片处理优化 (#1615)
Browse files Browse the repository at this point in the history
* 时间轴错误图片处理优化

* 捕获其他有可能的错误

---------

Co-authored-by: SHL-COOL <[email protected]>
  • Loading branch information
SHL-COOL and SHL-COOL authored Oct 9, 2023
1 parent 46cfe64 commit efb7a0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/options/views/UserDataTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ export default Vue.extend({
this.init();
},
mounted() {
this.replaceImageToBase64();
},
methods: {
init() {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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')
Expand All @@ -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);
},
Expand Down

0 comments on commit efb7a0a

Please sign in to comment.