+10
app/lish/Subscribe.tsx
+10
app/lish/Subscribe.tsx
···
186
186
pub_uri: string;
187
187
base_url: string;
188
188
subscribers: { identity: string }[];
189
+
pub_creator?: string;
189
190
}) => {
190
191
let { identity } = useIdentityData();
191
192
let searchParams = useSearchParams();
···
195
196
let subscribed =
196
197
identity?.atp_did &&
197
198
props.subscribers.find((s) => s.identity === identity.atp_did);
199
+
200
+
// Check if the logged-in user is the publication owner
201
+
let isOwner = identity?.atp_did && props.pub_creator === identity.atp_did;
198
202
199
203
if (successModalOpen)
200
204
return (
···
203
207
setOpen={setSuccessModalOpen}
204
208
/>
205
209
);
210
+
211
+
// Don't allow users to subscribe to their own publication
212
+
if (isOwner) {
213
+
return null;
214
+
}
215
+
206
216
if (subscribed) {
207
217
return <ManageSubscription {...props} />;
208
218
}
+4
app/lish/[did]/[publication]/[rkey]/LinearDocumentPage.tsx
+4
app/lish/[did]/[publication]/[rkey]/LinearDocumentPage.tsx