Allow pinning/unpinning other users posts

This commit is contained in:
jaina heartles 2024-02-27 14:57:27 -08:00
parent 401376d668
commit 1c50079f7b
2 changed files with 2 additions and 4 deletions

View file

@ -53,7 +53,6 @@ export class NotePiningService {
// Fetch pinee // Fetch pinee
const note = await this.notesRepository.findOneBy({ const note = await this.notesRepository.findOneBy({
id: noteId, id: noteId,
userId: user.id,
}); });
if (note == null) { if (note == null) {
@ -92,7 +91,6 @@ export class NotePiningService {
// Fetch unpinee // Fetch unpinee
const note = await this.notesRepository.findOneBy({ const note = await this.notesRepository.findOneBy({
id: noteId, id: noteId,
userId: user.id,
}); });
if (note == null) { if (note == null) {

View file

@ -341,7 +341,7 @@ export function getNoteMenu(props: {
text: i18n.ts.muteThread, text: i18n.ts.muteThread,
action: () => toggleThreadMute(true), action: () => toggleThreadMute(true),
}), }),
appearNote.userId === $i.id ? ($i.pinnedNoteIds ?? []).includes(appearNote.id) ? { ($i.pinnedNoteIds ?? []).includes(appearNote.id) ? {
icon: 'ph-push-pin ph-bold ph-lgned-off', icon: 'ph-push-pin ph-bold ph-lgned-off',
text: i18n.ts.unpin, text: i18n.ts.unpin,
action: () => togglePin(false), action: () => togglePin(false),
@ -349,7 +349,7 @@ export function getNoteMenu(props: {
icon: 'ph-push-pin ph-bold ph-lg', icon: 'ph-push-pin ph-bold ph-lg',
text: i18n.ts.pin, text: i18n.ts.pin,
action: () => togglePin(true), action: () => togglePin(true),
} : undefined, },
{ {
type: 'parent' as const, type: 'parent' as const,
icon: 'ph-user ph-bold ph-lg', icon: 'ph-user ph-bold ph-lg',