handle shapes not updating while selected and changed by others

This commit is contained in:
KDSBrowne 2024-02-28 15:06:31 +00:00
parent f2c48a3c9b
commit b68416249a

View File

@ -268,7 +268,11 @@ export default Whiteboard = React.memo(function Whiteboard(props) {
typeName: remoteShape.typeName, typeName: remoteShape.typeName,
}; };
if (!selectedShapeIds.includes(remoteShape.id) && prevShape?.meta?.updatedBy !== currentUser?.userId) { if (
(prevShape?.meta?.updatedBy !== currentUser?.userId && !selectedShapeIds.includes(remoteShape.id)) ||
(prevShape?.meta?.createdBy === currentUser?.userId) ||
(prevShape?.meta?.createdBy !== currentUser?.userId && selectedShapeIds.includes(remoteShape.id) && (isPresenter || isModerator))
) {
Object.keys(remoteShape).forEach((key) => { Object.keys(remoteShape).forEach((key) => {
if (key !== "isModerator" && !isEqual(remoteShape[key], localShape[key])) { if (key !== "isModerator" && !isEqual(remoteShape[key], localShape[key])) {
diff[key] = remoteShape[key]; diff[key] = remoteShape[key];