Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web: add readonly branch even in locked notes #5731

Merged
merged 2 commits into from
Jun 1, 2024

Conversation

uniqueeest
Copy link
Contributor

@uniqueeest uniqueeest commented May 21, 2024

The issue was that the "readonly" and "locked" states were being branched by the type of session object. Therefore, we were not able to check the read only when the type was "locked". So, we modified the read only to be branched according to the value of session.note.read only when it is locked.

  1. When locked, we added a readonly branch.
  2. I added a type accordingly.

Signed-off-by: Yoonjae Choi <dbswo9795@gmail.com>
@uniqueeest uniqueeest marked this pull request as draft May 29, 2024 05:02
@uniqueeest uniqueeest marked this pull request as ready for review May 29, 2024 05:02
@@ -782,6 +782,7 @@ type UnlockNoteViewProps = { session: LockedEditorSession };
function UnlockNoteView(props: UnlockNoteViewProps) {
const { session } = props;
const root = useRef<HTMLDivElement>(null);
const isReadOnly = session.note.readonly;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this constant here. We are only using it in one place so just inline it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thecodrr thank you! I modified it.

Signed-off-by: Yoonjae Choi <dbswo9795@email.com>
@thecodrr thecodrr merged commit 38f69b5 into streetwriters:master Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants