[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:
parent
c1f94a0928
commit
70e3c8bd45
5 changed files with 32 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue