Skip to content

Commit

Permalink
Only allow delete for author
Browse files Browse the repository at this point in the history
  • Loading branch information
gdbroman committed Aug 3, 2023
1 parent 320f26d commit f8f3ba4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ const NoteHeaderPresenter = () => {
<NoteHeaderView
author={selectedNote.author}
noteEditedAtString={noteEditedAtString}
contextMenuOptions={contextMenuOptions}
contextMenuOptions={
selectedNote.author === window.ship ? contextMenuOptions : []
}
saving={saving}
title={selectedNote.title}
onChange={onChangeTitle}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const NoteHeaderView = ({
</Flex>
{saving ? (
<Spinner size="19px" width={2} />
) : (
) : contextMenuOptions.length ? (
<Menu
id={`${title}-menu`}
orientation="bottom-left"
Expand All @@ -59,6 +59,6 @@ export const NoteHeaderView = ({
}
options={contextMenuOptions}
/>
)}
) : null}
</NoteHeaderContainer>
);

0 comments on commit f8f3ba4

Please sign in to comment.