Skip to content

Commit 86e1fbd

Browse files
committed
fix: 当获取不到评论时,loading 还在执行的 bug
1 parent d2ed930 commit 86e1fbd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/client/view/comments.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@
3636
3737
async function GetComment() {
3838
try {
39-
const { data } = await request({
39+
const { data, msg } = await request({
4040
url: D.serverURLs,
4141
data: { type: 'GET_COMMENT', path: D.path, pageNo }
4242
})
4343
44+
if (!data) throw new Error(msg)
45+
4446
counts = data.counts
4547
pageCount = data.pageCount
4648
comments = [...comments, ...data.comments]

src/client/view/main.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
}
5555
5656
function onCommentError() {
57-
onComment()
57+
onComment({})
5858
}
5959
6060
function wordLimitFn({ detail }) {

0 commit comments

Comments
 (0)