feat(home): enhance HomeScreen with API configuration checks and error handling

This commit is contained in:
zimplexing
2025-08-13 19:13:18 +08:00
parent fc81de1728
commit 5b6631624d
3 changed files with 34 additions and 7 deletions

View File

@@ -68,6 +68,7 @@ interface HomeState {
loadMoreData: () => Promise<void>;
selectCategory: (category: Category) => void;
refreshPlayRecords: () => Promise<void>;
clearError: () => void;
}
// 内存缓存,应用生命周期内有效
@@ -261,6 +262,10 @@ const useHomeStore = create<HomeState>((set, get) => ({
get().fetchInitialData();
},
clearError: () => {
set({ error: null });
},
}));
export default useHomeStore;