mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-05-19 15:49:01 +08:00
feat: add favorites screen and integrate it into navigation; enhance detail screen with favorite toggle functionality
This commit is contained in:
@@ -133,11 +133,11 @@ const useDetailStore = create<DetailState>((set, get) => ({
|
||||
set({ error: "未找到任何播放源" });
|
||||
}
|
||||
|
||||
// if (get().detail) {
|
||||
// const { source, id } = get().detail!;
|
||||
// const isFavorited = await FavoriteManager.isFavorited(source, id.toString());
|
||||
// set({ isFavorited });
|
||||
// }
|
||||
if (get().detail) {
|
||||
const { source, id } = get().detail!;
|
||||
const isFavorited = await FavoriteManager.isFavorited(source, id.toString());
|
||||
set({ isFavorited });
|
||||
}
|
||||
} catch (e) {
|
||||
if ((e as Error).name !== "AbortError") {
|
||||
set({ error: e instanceof Error ? e.message : "获取数据失败" });
|
||||
@@ -151,9 +151,9 @@ const useDetailStore = create<DetailState>((set, get) => ({
|
||||
|
||||
setDetail: async (detail) => {
|
||||
set({ detail });
|
||||
// const { source, id } = detail;
|
||||
// const isFavorited = await FavoriteManager.isFavorited(source, id.toString());
|
||||
// set({ isFavorited });
|
||||
const { source, id } = detail;
|
||||
const isFavorited = await FavoriteManager.isFavorited(source, id.toString());
|
||||
set({ isFavorited });
|
||||
},
|
||||
|
||||
abort: () => {
|
||||
|
||||
Reference in New Issue
Block a user