write access fix
This commit is contained in:
@@ -159,7 +159,8 @@ export const NotepadView: Component<{
|
||||
</div>
|
||||
}>
|
||||
{(note) => {
|
||||
const canEdit = note().user === currentUserId;
|
||||
const isOwner = note().user === currentUserId;
|
||||
const canEdit = isOwner || !note().isPrivate;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -186,7 +187,7 @@ export const NotepadView: Component<{
|
||||
}}
|
||||
/>
|
||||
<div class="flex items-center gap-2 shrink-0 pt-1">
|
||||
<Show when={canEdit}>
|
||||
<Show when={isOwner}>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
@@ -199,7 +200,7 @@ export const NotepadView: Component<{
|
||||
</Button>
|
||||
</Show>
|
||||
|
||||
<Show when={canEdit}>
|
||||
<Show when={isOwner}>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
|
||||
Reference in New Issue
Block a user