forked from akai/readest
@@ -65,7 +65,8 @@ export function useSync(bookKey?: string) {
|
||||
const { syncClient } = useSyncContext();
|
||||
|
||||
useEffect(() => {
|
||||
setIsSyncing(bookKey || '', syncing);
|
||||
if (!bookKey) return;
|
||||
setIsSyncing(bookKey, syncing);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [bookKey, syncing]);
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ export const useReaderStore = create<ReaderStore>((set, get) => ({
|
||||
getViewsById: (id: string) => {
|
||||
const { viewStates } = get();
|
||||
return Object.values(viewStates)
|
||||
.filter((state) => state.key.startsWith(id))
|
||||
.filter((state) => state.key && state.key.startsWith(id))
|
||||
.map((state) => state.view!);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user