This is one of the efforts to make the component more "(purely) functional" by extracting states out. States are global variables that should be avoided when possible.
Removed states:
state.role. Also removed all isGuest checks (replaced by a more functional state.editMode below).
state.user. The user is only used in Awareness and is now passed as function parameter to connectYjs action.
state.repoLoaded
Added states:
state.editMode: "edit" | "view". This could be set on-demand for web-ui when loading user authentication module.
Bug fix:
In Code.tsx and Rich.tsx, the Wrap didn't use correct width/height when the role was in "Guest".
This is one of the efforts to make the component more "(purely) functional" by extracting states out. States are global variables that should be avoided when possible.
Removed states:
state.role
. Also removed all isGuest checks (replaced by a more functional state.editMode below).state.user
. The user is only used in Awareness and is now passed as function parameter toconnectYjs
action.state.repoLoaded
Added states:
state.editMode: "edit" | "view"
. This could be set on-demand for web-ui when loading user authentication module.Bug fix:
Code.tsx
andRich.tsx
, the Wrap didn't use correct width/height when the role was in "Guest".