From 2f917000741c29f0288363eeacd68bfdfd95be1d Mon Sep 17 00:00:00 2001 From: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com> Date: Sat, 15 Jun 2024 01:16:17 +0000 Subject: [PATCH] Make uploads only viewable to oneself (#2540) --- lemmy-translations | 2 +- src/shared/components/person/profile.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lemmy-translations b/lemmy-translations index 866cf9f6..c3594b4f 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 866cf9f6469f99598be93dcce5e40f85d202ac22 +Subproject commit c3594b4fc024c2ac6a8dab7a97fda5350a5d77e1 diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 188bb820..fc1def65 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -301,6 +301,10 @@ export class Profile extends Component { fetchUploadsToken?: symbol; async fetchUploads(props: ProfileRouteProps) { + if (!this.amCurrentUser) { + return; + } + const token = (this.fetchUploadsToken = Symbol()); const { page } = props; this.setState({ uploadsRes: LOADING_REQUEST }); @@ -553,7 +557,7 @@ export class Profile extends Component { {this.getRadio(PersonDetailsView.Comments)} {this.getRadio(PersonDetailsView.Posts)} {this.amCurrentUser && this.getRadio(PersonDetailsView.Saved)} - {this.getRadio(PersonDetailsView.Uploads)} + {this.amCurrentUser && this.getRadio(PersonDetailsView.Uploads)} ); }