feat(channels): kick recent backfill immediately on 'full history' opt-in
When a user requests full history for a channel whose recent uploads aren't fetched yet, run a one-channel recent backfill synchronously in the request so the feed populates at once instead of waiting for the scheduler. Deep paging still follows on the scheduler (recent-then-deep). The deep-toggle mutation now also refreshes my-status and the feed.
This commit is contained in:
parent
5b8bac4c22
commit
f1009f06ed
2 changed files with 22 additions and 2 deletions
|
|
@ -44,7 +44,14 @@ export default function Channels({
|
|||
id: string;
|
||||
body: { priority?: number; hidden?: boolean; deep_requested?: boolean };
|
||||
}) => api.updateChannel(v.id, v.body),
|
||||
onSuccess: () => qc.invalidateQueries({ queryKey: ["channels"] }),
|
||||
// Requesting full history may have just pulled in a channel's recent uploads, so
|
||||
// refresh the per-user status and feed too — not only the channel list.
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: ["channels"] });
|
||||
qc.invalidateQueries({ queryKey: ["my-status"] });
|
||||
qc.invalidateQueries({ queryKey: ["feed"] });
|
||||
qc.invalidateQueries({ queryKey: ["feed-count"] });
|
||||
},
|
||||
});
|
||||
const attach = useMutation({
|
||||
mutationFn: (v: { id: string; tagId: number }) => api.attachChannelTag(v.id, v.tagId),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue