Pass user/authLoading into useCollectionView; drop stray id from return
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
c3529163b3
commit
91a92baa76
2 changed files with 3 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ import { downloadCollectionCardsCsv } from './collection-cards-csv.js';
|
|||
/**
|
||||
* Card/collection page state and handlers (god-component split).
|
||||
*/
|
||||
export function useCollectionView() {
|
||||
export function useCollectionView({ user = null, authLoading = true } = {}) {
|
||||
const router = useRouter();
|
||||
const { identifier } = router.query;
|
||||
|
||||
|
|
@ -435,7 +435,7 @@ export function useCollectionView() {
|
|||
}
|
||||
});
|
||||
|
||||
const showInitialLoading = loading;
|
||||
const showInitialLoading = authLoading || loading;
|
||||
|
||||
return {
|
||||
cards,
|
||||
|
|
@ -456,7 +456,6 @@ export function useCollectionView() {
|
|||
handleSearchCards,
|
||||
handleToggleFavorite,
|
||||
handleToggleSelect,
|
||||
id,
|
||||
identifier,
|
||||
isFavorited,
|
||||
loading,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { useCollectionView } from '../../lib/use-collection-view.js';
|
|||
|
||||
export default function CollectionView() {
|
||||
const { user, loading: authLoading } = useAuth();
|
||||
const collectionPage = useCollectionView();
|
||||
const collectionPage = useCollectionView({ user, authLoading });
|
||||
|
||||
if (collectionPage.showInitialLoading) {
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue