Skip to content

Commit

Permalink
test: added logs to debug player view
Browse files Browse the repository at this point in the history
  • Loading branch information
lgodier committed Dec 19, 2022
1 parent 9bc91fe commit 64f9a27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import { RecordOf } from 'immutable';

import React, { FC, ReactElement, useContext, useEffect } from 'react';
Expand Down Expand Up @@ -27,8 +28,12 @@ const App: FC = () => {
const renderContent = (): ReactElement => {
switch (context.get('context')) {
case Context.BUILDER:
console.log('rendering for builder');
return <LoadView />;
case Context.ANALYTICS:
return <Loader />;
case Context.PLAYER:
console.log('rendering for player');
return <LoadView />;
default:
return <Loader />;
Expand Down
4 changes: 4 additions & 0 deletions src/components/Excalidraw.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import { debounce } from 'lodash';

import React, { ReactElement, useRef } from 'react';
Expand Down Expand Up @@ -50,6 +51,7 @@ const GetView = (prop: { appData: AppData }): ReactElement => {
elements: readonly ExcalidrawElement[],
state: AppState,
): void {
console.log('handling changes');
debouncedPatch(elements, state);
}

Expand Down Expand Up @@ -92,6 +94,7 @@ const LoadView = (): ReactElement => {
// get if empty send empty and create else send new vals
const appData = appDataArray.find(({ type }) => type === 'session');
if (!appData) {
console.log('posting app data');
postAppData({
data: {
elements: [],
Expand All @@ -103,6 +106,7 @@ const LoadView = (): ReactElement => {
type: APP_DATA_TYPES.SESSION_TYPE,
visibility: APP_DATA_VISIBILITY.MEMBER,
});
console.log('stopped here in Load View');
return <Loader />;
}
return <GetView appData={appData} />;
Expand Down

0 comments on commit 64f9a27

Please sign in to comment.