-
Notifications
You must be signed in to change notification settings - Fork 171
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
Input/controls constraints for viewers #4713
Changes from all commits
17d4d3d
257d995
40a0862
87b201c
7caaecf
ab93e70
de666a8
b6563b8
ac5685d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -717,3 +717,11 @@ export function useAllowedToEditProject(): boolean { | |
'useAllowedToEditProject', | ||
) | ||
} | ||
|
||
export function useIsMyProject(): boolean { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this clash with the baton passing work? I'm thinking that a lot of the places using this check should be instead using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it clashes, but it definitely makes it more granular. My take would be to wait that there are no baton-opened PRs to revisit and update |
||
return useEditorState( | ||
Substores.projectServerState, | ||
(store) => store.projectServerState.isMyProject === 'yes', | ||
'useIsMyProject', | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have some other
INSERT_
shortcuts that might need this check thenThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed (not just
insert_
but a lot more), but since changes cannot propagate, I added this here like we did for the text mode so the cursor does not change to a misleading crosshair, it's not meant to safeguard from the insertion per-se, as it's implicitly prevented by the collaboration