Skip to content

Commit

Permalink
fix: set only page id on instance
Browse files Browse the repository at this point in the history
  • Loading branch information
eswarclynn committed May 15, 2024
1 parent c1e38a5 commit 0a30aba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
13 changes: 1 addition & 12 deletions examples/prebuilt-react-integration/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,5 @@ import { getRoomCodeFromUrl } from './utils';
export default function App() {
const roomCode = getRoomCodeFromUrl();

return (
<HMSPrebuilt
roomCode={roomCode}
options={{
endpoints: {
tokenByRoomCode: 'https://auth-nonprod.100ms.live/v2/token',
roomLayout: 'https://api-nonprod.100ms.live/v2/layouts/ui',
init: 'https://qa-in2-ipv6.100ms.live/init',
},
}}
/>
);
return <HMSPrebuilt roomCode={roomCode} />;
}
9 changes: 7 additions & 2 deletions packages/hms-whiteboard/src/hooks/useCollaboration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
HistoryEntry,
throttle,
TLAnyShapeUtilConstructor,
TLInstance,
TLINSTANCE_ID,
TLPage,
TLRecord,
TLStoreWithStatus,
Expand Down Expand Up @@ -199,8 +201,11 @@ export function useCollaboration({
const newPage = editor?.getCurrentPage();

if (newPage?.id !== currentPage?.id) {
const instance = editor.getInstanceState();
sessionStore?.set(instance.id, instance);
sessionStore.get(TLINSTANCE_ID).then(instance => {
if (instance) {
sessionStore?.set(instance.id, { ...instance, currentPageId: newPage?.id } as TLInstance);
}
});
setCurrentPage(newPage);
}
});
Expand Down

0 comments on commit 0a30aba

Please sign in to comment.