refactor(ImageGallery, HomeScreen, PostService, UserStore): streamline post type handling and improve tab navigation
- Updated ImageGallery to manage loading states more effectively and prevent unnecessary updates. - Refactored HomeScreen to remove the 'recommend' post type, simplifying the post type options. - Adjusted PostService and UserStore to eliminate references to 'recommend', ensuring consistency across the application. - Enhanced tab navigation in SimpleMobileTabNavigator to optimize rendering and manage mounted tabs more efficiently. - Improved error handling and loading states in various components for better user experience.
This commit is contained in:
@@ -63,11 +63,6 @@ class PostService {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
// 获取推荐帖子
|
||||
async getRecommendedPosts(page = 1, pageSize = 20): Promise<PaginatedData<Post>> {
|
||||
return this.getPosts(page, pageSize, 'recommend');
|
||||
}
|
||||
|
||||
// 获取关注帖子
|
||||
async getFollowingPosts(page = 1, pageSize = 20): Promise<PaginatedData<Post>> {
|
||||
return this.getPosts(page, pageSize, 'follow');
|
||||
@@ -282,7 +277,7 @@ class PostService {
|
||||
/**
|
||||
* 获取帖子列表(游标分页)
|
||||
* GET /api/v1/posts
|
||||
* @param params 游标分页请求参数(包含 post_type 可选:recommend, follow, hot, latest)
|
||||
* @param params 游标分页请求参数(包含 post_type 可选:follow, hot, latest)
|
||||
*/
|
||||
async getPostsCursor(
|
||||
params: CursorPaginationRequest = {}
|
||||
|
||||
Reference in New Issue
Block a user