tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
291
fork
atom
a tool for shared writing and social publishing
291
fork
atom
overview
issues
28
pulls
pipelines
use rkey in publicationswrprovider
awarm.space
6 months ago
957d533d
0313f1d5
+7
-6
2 changed files
expand all
collapse all
unified
split
app
lish
[did]
[publication]
dashboard
PublicationSWRProvider.tsx
page.tsx
+2
-2
app/lish/[did]/[publication]/dashboard/PublicationSWRProvider.tsx
···
7
7
8
8
const PublicationContext = createContext({ name: "", did: "" });
9
9
export function PublicationSWRDataProvider(props: {
10
10
-
publication_name: string;
10
10
+
publication_rkey: string;
11
11
publication_did: string;
12
12
publication_data: GetPublicationDataReturnType["result"];
13
13
children: React.ReactNode;
···
15
15
let key = `publication-data-${props.publication_did}`;
16
16
return (
17
17
<PublicationContext
18
18
-
value={{ name: props.publication_name, did: props.publication_did }}
18
18
+
value={{ name: props.publication_rkey, did: props.publication_did }}
19
19
>
20
20
<SWRConfig
21
21
value={{
+5
-4
app/lish/[did]/[publication]/dashboard/page.tsx
···
20
20
PublicationThemeProviderDashboard,
21
21
} from "components/ThemeManager/PublicationThemeProvider";
22
22
import { blobRefToSrc } from "src/utils/blobRefToSrc";
23
23
+
import { AtUri } from "@atproto/syntax";
23
24
24
25
export async function generateMetadata(props: {
25
26
params: Promise<{ publication: string; did: string }>;
···
66
67
{ supabase: supabaseServerClient },
67
68
);
68
69
70
70
+
if (!publication || identity.atp_did !== publication.identity_did)
71
71
+
return <PubNotFound />;
69
72
let record = publication?.record as PubLeafletPublication.Record | null;
73
73
+
let uri = new AtUri(publication.uri);
70
74
71
75
let showPageBackground = !!record?.theme?.showPageBackground;
72
76
73
73
-
if (!publication || identity.atp_did !== publication.identity_did)
74
74
-
return <PubNotFound />;
75
75
-
76
77
try {
77
78
return (
78
79
<PublicationSWRDataProvider
79
80
publication_did={did}
80
80
-
publication_name={publication.name}
81
81
+
publication_rkey={uri.rkey}
81
82
publication_data={publication}
82
83
>
83
84
<PublicationThemeProviderDashboard record={record}>