diff --git a/open-isle-cli/src/views/PostPageView.vue b/open-isle-cli/src/views/PostPageView.vue index b6e313861..fd34246e5 100644 --- a/open-isle-cli/src/views/PostPageView.vue +++ b/open-isle-cli/src/views/PostPageView.vue @@ -73,21 +73,16 @@ -
+
+ +
+
-
@@ -155,6 +150,7 @@ export default { const currentIndex = ref(1) const subscribed = ref(false) const commentSort = ref('NEWEST') + const isFetchingComments = ref(false) // record default metadata from the main document const defaultTitle = document.title @@ -527,11 +523,13 @@ export default { return Promise.resolve([ { id: 'NEWEST', name: '最新', icon: 'fas fa-clock' }, { id: 'OLDEST', name: '最旧', icon: 'fas fa-hourglass-start' }, - { id: 'MOST_INTERACTIONS', name: '最多互动', icon: 'fas fa-fire' } + // { id: 'MOST_INTERACTIONS', name: '最多互动', icon: 'fas fa-fire' } ]) } const fetchComments = async () => { + isFetchingComments.value = true + await new Promise(resolve => setTimeout(resolve, 1000)) try { const token = getToken() const res = await fetch(`${API_BASE_URL}/api/posts/${postId}/comments?sort=${commentSort.value}`, { @@ -545,6 +543,8 @@ export default { } } catch { // ignore + } finally { + isFetchingComments.value = false } } @@ -622,7 +622,8 @@ export default { isMobile, pinnedAt, commentSort, - fetchCommentSorts + fetchCommentSorts, + isFetchingComments } } }