The Channel manager lists the channels the Takeout history shows watched often but not followed, the most watched first: twenty at a time, the channel's About on hover, its name to its page, Follow, and Not interested with an Undo. A row's count opens the videos it counts, ready to play one or all. Before a history is uploaded it points to the upload; while the import still asks YouTube it says more channels may join.
21 lines
770 B
TypeScript
21 lines
770 B
TypeScript
import type { QueryClient } from "@tanstack/react-query";
|
|
|
|
import { qk } from "./queryKeys";
|
|
|
|
/** Everything a subscribe or an unsubscribe changes: the channel itself, the manager's list and its
|
|
* counts, the feed and its facets (the channel's videos come or go), and the two discovery lists (a
|
|
* subscribed channel leaves them). ONE set for every site that makes the change: each used to keep
|
|
* its own list, and each list missed something. */
|
|
export function invalidateSubscription(qc: QueryClient, channelId: string): void {
|
|
for (const queryKey of [
|
|
qk.channel(channelId),
|
|
qk.channels(),
|
|
qk.myStatus(),
|
|
qk.feed(),
|
|
qk.feedSummary(),
|
|
qk.discoveredChannels(),
|
|
qk.watchedChannels(),
|
|
])
|
|
void qc.invalidateQueries({ queryKey });
|
|
}
|