[fix] bug with images that have the same name (#743)

* add unique id to file names to avoid name clashes

* Add event callbacks for `onSessionStart` and `onSessionEnd`
This commit is contained in:
Steve Ruiz 2022-06-25 12:28:18 +01:00 committed by GitHub
parent c1f94a0928
commit 70e3c8bd45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 5 deletions

View file

@ -216,10 +216,22 @@ export function useMultiplayerState(roomId: string) {
}
}, [room, app])
const onSessionStart = React.useCallback(() => {
if (!room) return
room.history.pause()
}, [room])
const onSessionEnd = React.useCallback(() => {
if (!room) return
room.history.resume()
}, [room])
return {
onUndo,
onRedo,
onMount,
onSessionStart,
onSessionEnd,
onChangePage,
onChangePresence,
error,