Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix: 修复 IOS 下不支持 Promise.finally 语法的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Jun 29, 2018
1 parent 6d56b7e commit 58c25dc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/components/FeedCard/FeedCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,9 @@ export default {
this.commentCount += 1;
this.comments.unshift(data.comment);
this.$Message.success("评论成功");
bus.$emit("commentInput:close", true);
})
.finally(() => {
.catch(() => {
bus.$emit("commentInput:close", true);
});
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/FeedCard/GroupFeedCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export default {
this.commentCount += 1;
this.comments.unshift(data.comment);
this.$Message.success("评论成功");
bus.$emit("commentInput:close", true);
})
.finally(() => {
.catch(() => {
bus.$emit("commentInput:close", true);
});
},
Expand Down
5 changes: 3 additions & 2 deletions src/page/feed/feedDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,12 @@ export default {
}`
: ""
});
if (callback && typeof callback === "function") {
callback();
}
})
.catch(() => {
this.goBack();
})
.finally(() => {
if (callback && typeof callback === "function") {
callback();
}
Expand Down
3 changes: 2 additions & 1 deletion src/page/news/newsDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ export default {
comments.length
? (this.maxComId = comments[comments.length - 1].id)
: (this.noMoreCom = true);
this.fetchComing = false;
})
.finally(() => {
.catch(() => {
this.fetchComing = false;
});
},
Expand Down

0 comments on commit 58c25dc

Please sign in to comment.