fix(refboard): broadcast scene changes to other clients immediately
onCanvasChange now calls broadcastSceneNow() so rearrangement, alignment, and other bulk operations sync to other tabs in real-time instead of waiting for the next periodic sync or page reload.
This commit is contained in:
@@ -105,6 +105,8 @@ export default function Editor({ isPublicView }: EditorProps) {
|
|||||||
// Canvas change handler
|
// Canvas change handler
|
||||||
const onCanvasChange = useCallback(() => {
|
const onCanvasChange = useCallback(() => {
|
||||||
scheduleSave();
|
scheduleSave();
|
||||||
|
// Broadcast changes to other connected clients immediately
|
||||||
|
syncRef.current?.broadcastSceneNow();
|
||||||
if (undoRef.current && !undoRef.current.isLocked()) {
|
if (undoRef.current && !undoRef.current.isLocked()) {
|
||||||
undoRef.current.saveState();
|
undoRef.current.saveState();
|
||||||
setCanUndo(undoRef.current.canUndo());
|
setCanUndo(undoRef.current.canUndo());
|
||||||
|
|||||||
Reference in New Issue
Block a user