Something went wrong. Try again.
The Social Wire — a comprehensive client for creating on the atmosphere thesocialwire.app
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657import type { DiscoveredPublication } from "@/lib/atprotoClient";import type { GatewayMarkAllReadScope } from "@/lib/publicationProjectionClient";
export type ActiveReadFeedScope = { publications: DiscoveredPublication[]; gatewayScope: GatewayMarkAllReadScope; displayName: string;};
export function activeReadFeedScope({ folderRkey, folderName, folderPublications, selectedPublication, selectedTopLevelFeed, subscribedPublications, followingPublications,}: { folderRkey: string | null; folderName?: string; folderPublications: DiscoveredPublication[]; selectedPublication?: DiscoveredPublication; selectedTopLevelFeed: "subscribed" | "following"; subscribedPublications: DiscoveredPublication[]; followingPublications: DiscoveredPublication[];}): ActiveReadFeedScope { if (folderRkey) { return { publications: folderPublications, gatewayScope: { kind: "folder", folderRkey }, displayName: folderName?.trim() || "", }; } if (selectedPublication) { return { publications: [selectedPublication], gatewayScope: { kind: "publication", publicationId: selectedPublication.publicationId, }, displayName: selectedPublication.title, }; } if (selectedTopLevelFeed === "following") { return { publications: followingPublications, gatewayScope: { kind: "following" }, displayName: "Following", }; } return { publications: subscribedPublications, gatewayScope: { kind: "subscribed" }, displayName: "Subscribed", };}