v3: fixes to database schema and user registration
This commit is contained in:
@@ -10,7 +10,11 @@ import { Link, useParams } from "react-router";
|
||||
import { API_URL, DEFAULT_PAGE_SIZE } from "../config/api.ts";
|
||||
import { friendlyFetchError } from "../utils/apiError.ts";
|
||||
import type { Dump, PaginatedData, PublicUser, RawDump } from "../model.ts";
|
||||
import { deserializeDump, deserializePublicUser, hydrateDump } from "../model.ts";
|
||||
import {
|
||||
deserializeDump,
|
||||
deserializePublicUser,
|
||||
hydrateDump,
|
||||
} from "../model.ts";
|
||||
import { useAuth } from "../hooks/useAuth.ts";
|
||||
import { useWS } from "../hooks/useWS.ts";
|
||||
import { useDumpListSync } from "../hooks/useDumpListSync.ts";
|
||||
@@ -136,8 +140,8 @@ export function UserUpvoted() {
|
||||
}
|
||||
const prev = prevMyVotesRef.current;
|
||||
setVotedIds(new Set(myVotes));
|
||||
for (const id of prev) { if (!myVotes.has(id)) startFading(id); }
|
||||
for (const id of myVotes) { if (!prev.has(id)) cancelFading(id); }
|
||||
for (const id of prev) if (!myVotes.has(id)) startFading(id);
|
||||
for (const id of myVotes) if (!prev.has(id)) cancelFading(id);
|
||||
prevMyVotesRef.current = new Set(myVotes);
|
||||
}, [myVotes, me, profileUserId, startFading, cancelFading]);
|
||||
|
||||
@@ -174,7 +178,6 @@ export function UserUpvoted() {
|
||||
}
|
||||
}, [lastVoteEvent, profileUserId, startFading, cancelFading]);
|
||||
|
||||
|
||||
const loadMore = useCallback(() => {
|
||||
if (
|
||||
state.status !== "loaded" || !state.hasMore || state.loadingMore ||
|
||||
@@ -263,7 +266,9 @@ export function UserUpvoted() {
|
||||
}
|
||||
|
||||
const { profileUser, votes, hasMore, loadingMore } = state;
|
||||
const visibleDumps = votes.filter((d) => votedIds.has(d.id) || d.id in fading);
|
||||
const visibleDumps = votes.filter((d) =>
|
||||
votedIds.has(d.id) || d.id in fading
|
||||
);
|
||||
|
||||
return (
|
||||
<PageShell>
|
||||
|
||||
Reference in New Issue
Block a user