Skip to content

Commit

Permalink
web: fix readonly locked notes opening as editable (#5731)
Browse files Browse the repository at this point in the history
Signed-off-by: Yoonjae Choi <dbswo9795@email.com>
  • Loading branch information
uniqueeest authored Jun 1, 2024
1 parent b502f6a commit 38f69b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/web/src/components/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ function UnlockNoteView(props: UnlockNoteViewProps) {
throw new Error("note with this id does not exist.");

useEditorStore.getState().addSession({
type: "default",
type: session.note.readonly ? "readonly" : "default",
locked: true,
id: session.id,
note: session.note,
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/stores/editor-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export type ReadonlyEditorSession = BaseEditorSession & {
content?: NoteContent<false>;
color?: string;
tags?: Tag[];
locked?: boolean;
};

export type DeletedEditorSession = BaseEditorSession & {
Expand Down

0 comments on commit 38f69b5

Please # to comment.